@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add storage for new Differential transactions and transaction comments

Summary:
Ref T2222. Ref T1460. Depends on D6260.

This creates the new tables, but doesn't start using them. I added three new fields for {T1460}, to represent fixed/done/replied states.

Test Plan: Ran storage upgrade.

Reviewers: btrahan

Reviewed By: btrahan

CC: chad, aran

Maniphest Tasks: T1460, T2222

Differential Revision: https://secure.phabricator.com/D6261

+103
+51
resources/sql/patches/20130620.diffxactions.sql
··· 1 + CREATE TABLE {$NAMESPACE}_differential.differential_transaction ( 2 + id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 3 + phid VARCHAR(64) NOT NULL COLLATE utf8_bin, 4 + authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin, 5 + objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin, 6 + viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin, 7 + editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin, 8 + commentPHID VARCHAR(64) COLLATE utf8_bin, 9 + commentVersion INT UNSIGNED NOT NULL, 10 + transactionType VARCHAR(32) NOT NULL COLLATE utf8_bin, 11 + oldValue LONGTEXT NOT NULL COLLATE utf8_bin, 12 + newValue LONGTEXT NOT NULL COLLATE utf8_bin, 13 + contentSource LONGTEXT NOT NULL COLLATE utf8_bin, 14 + metadata LONGTEXT NOT NULL COLLATE utf8_bin, 15 + dateCreated INT UNSIGNED NOT NULL, 16 + dateModified INT UNSIGNED NOT NULL, 17 + 18 + UNIQUE KEY `key_phid` (phid), 19 + KEY `key_object` (objectPHID) 20 + 21 + ) ENGINE=InnoDB, COLLATE utf8_general_ci; 22 + 23 + CREATE TABLE {$NAMESPACE}_differential.differential_transaction_comment ( 24 + id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 25 + phid VARCHAR(64) NOT NULL COLLATE utf8_bin, 26 + transactionPHID VARCHAR(64) COLLATE utf8_bin, 27 + authorPHID VARCHAR(64) NOT NULL COLLATE utf8_bin, 28 + viewPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin, 29 + editPolicy VARCHAR(64) NOT NULL COLLATE utf8_bin, 30 + commentVersion INT UNSIGNED NOT NULL, 31 + content LONGTEXT NOT NULL COLLATE utf8_bin, 32 + contentSource LONGTEXT NOT NULL COLLATE utf8_bin, 33 + isDeleted BOOL NOT NULL, 34 + dateCreated INT UNSIGNED NOT NULL, 35 + dateModified INT UNSIGNED NOT NULL, 36 + 37 + revisionPHID VARCHAR(64) NOT NULL COLLATE utf8_bin, 38 + changesetID INT UNSIGNED, 39 + isNewFile BOOL NOT NULL, 40 + lineNumber INT UNSIGNED NOT NULL, 41 + lineLength INT UNSIGNED NOT NULL, 42 + fixedState VARCHAR(12) COLLATE utf8_bin, 43 + hasReplies BOOL NOT NULL, 44 + replyToCommentPHID VARCHAR(64), 45 + 46 + UNIQUE KEY `key_phid` (phid), 47 + UNIQUE KEY `key_version` (transactionPHID, commentVersion), 48 + UNIQUE KEY `key_draft` (authorPHID, revisionPHID, transactionPHID) 49 + 50 + ) ENGINE=InnoDB, COLLATE utf8_general_ci; 51 +
+4
src/__phutil_library_map__.php
··· 417 417 'DifferentialTasksAttacher' => 'applications/differential/DifferentialTasksAttacher.php', 418 418 'DifferentialTestPlanFieldSpecification' => 'applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php', 419 419 'DifferentialTitleFieldSpecification' => 'applications/differential/field/specification/DifferentialTitleFieldSpecification.php', 420 + 'DifferentialTransaction' => 'applications/differential/storage/DifferentialTransaction.php', 421 + 'DifferentialTransactionComment' => 'applications/differential/storage/DifferentialTransactionComment.php', 420 422 'DifferentialUnitFieldSpecification' => 'applications/differential/field/specification/DifferentialUnitFieldSpecification.php', 421 423 'DifferentialUnitStatus' => 'applications/differential/constants/DifferentialUnitStatus.php', 422 424 'DifferentialUnitTestResult' => 'applications/differential/constants/DifferentialUnitTestResult.php', ··· 2292 2294 'DifferentialSummaryFieldSpecification' => 'DifferentialFreeformFieldSpecification', 2293 2295 'DifferentialTestPlanFieldSpecification' => 'DifferentialFieldSpecification', 2294 2296 'DifferentialTitleFieldSpecification' => 'DifferentialFreeformFieldSpecification', 2297 + 'DifferentialTransaction' => 'PhabricatorApplicationTransaction', 2298 + 'DifferentialTransactionComment' => 'PhabricatorApplicationTransactionComment', 2295 2299 'DifferentialUnitFieldSpecification' => 'DifferentialFieldSpecification', 2296 2300 'DiffusionBranchTableController' => 'DiffusionController', 2297 2301 'DiffusionBranchTableView' => 'DiffusionView',
+21
src/applications/differential/storage/DifferentialTransaction.php
··· 1 + <?php 2 + 3 + final class DifferentialTransaction extends PhabricatorApplicationTransaction { 4 + 5 + public function getApplicationName() { 6 + return 'differential'; 7 + } 8 + 9 + public function getApplicationTransactionType() { 10 + return PhabricatorPHIDConstants::PHID_TYPE_DREV; 11 + } 12 + 13 + public function getApplicationTransactionCommentObject() { 14 + return new DifferentialTransactionComment(); 15 + } 16 + 17 + public function getApplicationObjectTypeName() { 18 + return pht('revision'); 19 + } 20 + 21 + }
+23
src/applications/differential/storage/DifferentialTransactionComment.php
··· 1 + <?php 2 + 3 + final class DifferentialTransactionComment 4 + extends PhabricatorApplicationTransactionComment { 5 + 6 + protected $revisionPHID; 7 + protected $changesetID; 8 + protected $isNewFile; 9 + protected $lineNumber; 10 + protected $lineLength; 11 + protected $fixedState; 12 + protected $hasReplies = 0; 13 + protected $replyToCommentPHID; 14 + 15 + public function getApplicationTransactionObject() { 16 + return new DifferentialTransaction(); 17 + } 18 + 19 + public function shouldUseMarkupCache($field) { 20 + // Only cache submitted comments. 21 + return ($this->getTransactionPHID() != null); 22 + } 23 + }
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1378 1378 'type' => 'php', 1379 1379 'name' => $this->getPatchPath('20130619.authconf.php'), 1380 1380 ), 1381 + '20130620.diffxactions.sql' => array( 1382 + 'type' => 'sql', 1383 + 'name' => $this->getPatchPath('20130620.diffxactions.sql'), 1384 + ), 1381 1385 ); 1382 1386 } 1383 1387 }