1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 10:52:41 +01:00
phorge-phorge/resources/sql/autopatches/20140501.remove.1.dlog.sql
epriestley 2022a70e16 Implement bin/remove, for structured destruction of objects
Summary:
Ref T4749. Ref T3265. Ref T4909. Several goals here:

  - Move user destruction to the CLI to limit the power of rogue admins.
  - Start consolidating all "destroy named object" scripts into a single UI, to make it easier to know how to destroy things.
  - Structure object destruction so we can do a better and more automatic job of cleaning up transactions, edges, search indexes, etc.
  - Log when we destroy objects so there's a record if data goes missing.

Test Plan: Used `bin/remove destroy` to destroy several users.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3265, T4749, T4909

Differential Revision: https://secure.phabricator.com/D8940
2014-05-01 18:23:31 -07:00

9 lines
381 B
SQL

CREATE TABLE {$NAMESPACE}_system.system_destructionlog (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
objectClass VARCHAR(128) NOT NULL COLLATE utf8_bin,
rootLogID INT UNSIGNED,
objectPHID VARCHAR(64) COLLATE utf8_bin,
objectMonogram VARCHAR(64) COLLATE utf8_bin,
epoch INT UNSIGNED NOT NULL,
KEY `key_epoch` (epoch)
) ENGINE=InnoDB, COLLATE utf8_general_ci;