1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +01:00
phorge-phorge/resources/sql/autopatches/20140722.audit.2.comments.sql
epriestley 416f3d9ede Add storage for new audit transactions and comments
Summary:
Ref T4896. This adds the new storage, without any code changes.

This storage is substantially identical to the Differential storage, except that `changesetID` has been replaced by `pathID`.

I've retained the properties intended to be used to implement T1460. They might not be quite right, but at least we'll be able to make any fixes consistently to both applications. For now, these fields are empty and ignored.

Test Plan: Ran `./bin/storage upgrade`. Nothing calls this code yet.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T4896

Differential Revision: https://secure.phabricator.com/D10017
2014-07-24 17:59:43 -07:00

29 lines
1.2 KiB
SQL

CREATE TABLE {$NAMESPACE}_audit.audit_transaction_comment (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
phid VARCHAR(64) COLLATE utf8_bin NOT NULL,
transactionPHID VARCHAR(64) COLLATE utf8_bin,
authorPHID VARCHAR(64) COLLATE utf8_bin NOT NULL,
viewPolicy VARCHAR(64) COLLATE utf8_bin NOT NULL,
editPolicy VARCHAR(64) COLLATE utf8_bin NOT NULL,
commentVersion INT UNSIGNED NOT NULL,
content longtext COLLATE utf8_bin NOT NULL,
contentSource longtext COLLATE utf8_bin NOT NULL,
isDeleted BOOL NOT NULL,
dateCreated INT UNSIGNED NOT NULL,
dateModified INT UNSIGNED NOT NULL,
commitPHID VARCHAR(64) COLLATE utf8_bin,
pathID INT UNSIGNED,
isNewFile BOOL NOT NULL,
lineNumber INT UNSIGNED NOT NULL,
lineLength INT UNSIGNED NOT NULL,
fixedState VARCHAR(12) COLLATE utf8_bin,
hasReplies BOOL NOT NULL,
replyToCommentPHID VARCHAR(64) COLLATE utf8_bin,
legacyCommentID INT UNSIGNED,
UNIQUE KEY `key_phid` (phid),
UNIQUE KEY `key_version` (transactionPHID, commentVersion),
KEY `key_path` (pathID),
KEY `key_draft` (authorPHID, transactionPHID),
KEY `key_commit` (commitPHID),
KEY `key_legacy` (legacyCommentID)
) ENGINE=InnoDB, COLLATE utf8_general_ci;