@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.

Generate expected schemata for Differential

Summary: Ref T1191. No major issues here.

Test Plan: Saw ~150 fewer issues.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

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

+245 -5
+14 -2
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
··· 138 138 'src' => array( 139 139 'columns' => array('src', 'type', 'dateCreated', 'seq'), 140 140 ), 141 + 'key_dst' => array( 142 + 'columns' => array('dst', 'type', 'src'), 143 + 'unique' => true, 144 + ), 141 145 )); 142 146 143 147 $this->buildRawSchema( ··· 251 255 $charset = 'binary'; 252 256 $collation = 'binary'; 253 257 break; 258 + case 'bytes20': 259 + $column_type = 'char(20)'; 260 + $charset = 'binary'; 261 + $collation = 'binary'; 262 + break; 254 263 case 'bytes12': 255 264 $column_type = 'char(12)'; 256 265 $charset = 'binary'; 257 266 $collation = 'binary'; 258 267 break; 259 - case 'bytes': 260 - $column_type = 'longblob'; 268 + case 'bytes4': 269 + $column_type = 'char(4)'; 261 270 $charset = 'binary'; 262 271 $collation = 'binary'; 272 + break; 273 + case 'bytes': 274 + $column_type = 'longblob'; 263 275 break; 264 276 case 'text255': 265 277 $column_type = 'varchar(255)';
+12
src/applications/differential/storage/DifferentialAffectedPath.php
··· 14 14 public function getConfiguration() { 15 15 return array( 16 16 self::CONFIG_TIMESTAMPS => false, 17 + self::CONFIG_COLUMN_SCHEMA => array( 18 + 'id' => null, 19 + ), 20 + self::CONFIG_KEY_SCHEMA => array( 21 + 'PRIMARY' => null, 22 + 'repositoryID' => array( 23 + 'columns' => array('repositoryID', 'pathID', 'epoch'), 24 + ), 25 + 'revisionID' => array( 26 + 'columns' => array('revisionID'), 27 + ), 28 + ), 17 29 ) + parent::getConfiguration(); 18 30 } 19 31
+15 -1
src/applications/differential/storage/DifferentialChangeset.php
··· 28 28 'oldProperties' => self::SERIALIZATION_JSON, 29 29 'newProperties' => self::SERIALIZATION_JSON, 30 30 'awayPaths' => self::SERIALIZATION_JSON, 31 - )) + parent::getConfiguration(); 31 + ), 32 + self::CONFIG_COLUMN_SCHEMA => array( 33 + 'oldFile' => 'text255?', 34 + 'filename' => 'text255', 35 + 'changeType' => 'uint32', 36 + 'fileType' => 'uint32', 37 + 'addLines' => 'uint32', 38 + 'delLines' => 'uint32', 39 + ), 40 + self::CONFIG_KEY_SCHEMA => array( 41 + 'diffID' => array( 42 + 'columns' => array('diffID'), 43 + ), 44 + ), 45 + ) + parent::getConfiguration(); 32 46 } 33 47 34 48 public function getAffectedLineCount() {
+24
src/applications/differential/storage/DifferentialDiff.php
··· 42 42 public function getConfiguration() { 43 43 return array( 44 44 self::CONFIG_AUX_PHID => true, 45 + self::CONFIG_COLUMN_SCHEMA => array( 46 + 'revisionID' => 'id?', 47 + 'authorPHID' => 'phid?', 48 + 'repositoryPHID' => 'phid?', 49 + 'sourceMachine' => 'text255?', 50 + 'sourcePath' => 'text255?', 51 + 'sourceControlSystem' => 'text64?', 52 + 'sourceControlBaseRevision' => 'text255?', 53 + 'sourceControlPath' => 'text255?', 54 + 'lintStatus' => 'uint32', 55 + 'unitStatus' => 'uint32', 56 + 'lineCount' => 'uint32', 57 + 'branch' => 'text255?', 58 + 'bookmark' => 'text255?', 59 + 'arcanistProjectPHID' => 'phid?', 60 + 'creationMethod' => 'text255', 61 + 'description' => 'text255', 62 + 'repositoryUUID' => 'text64?', 63 + ), 64 + self::CONFIG_KEY_SCHEMA => array( 65 + 'revisionID' => array( 66 + 'columns' => array('revisionID'), 67 + ), 68 + ), 45 69 ) + parent::getConfiguration(); 46 70 } 47 71
+11 -1
src/applications/differential/storage/DifferentialDiffProperty.php
··· 10 10 return array( 11 11 self::CONFIG_SERIALIZATION => array( 12 12 'data' => self::SERIALIZATION_JSON, 13 - )) + parent::getConfiguration(); 13 + ), 14 + self::CONFIG_COLUMN_SCHEMA => array( 15 + 'name' => 'text255', 16 + ), 17 + self::CONFIG_KEY_SCHEMA => array( 18 + 'diffID' => array( 19 + 'columns' => array('diffID', 'name'), 20 + 'unique' => true, 21 + ), 22 + ), 23 + ) + parent::getConfiguration(); 14 24 } 15 25 16 26 }
+14
src/applications/differential/storage/DifferentialDraft.php
··· 6 6 protected $authorPHID; 7 7 protected $draftKey; 8 8 9 + public function getConfiguration() { 10 + return array( 11 + self::CONFIG_COLUMN_SCHEMA => array( 12 + 'draftKey' => 'text64', 13 + ), 14 + self::CONFIG_KEY_SCHEMA => array( 15 + 'key_unique' => array( 16 + 'columns' => array('objectPHID', 'authorPHID', 'draftKey'), 17 + 'unique' => true, 18 + ), 19 + ), 20 + ) + parent::getConfiguration(); 21 + } 22 + 9 23 public static function markHasDraft( 10 24 $author_phid, 11 25 $object_phid,
+17
src/applications/differential/storage/DifferentialHunkLegacy.php
··· 4 4 5 5 protected $changes; 6 6 7 + public function getConfiguration() { 8 + return array( 9 + self::CONFIG_COLUMN_SCHEMA => array( 10 + 'changes' => 'text?', 11 + 'oldOffset' => 'uint32', 12 + 'oldLen' => 'uint32', 13 + 'newOffset' => 'uint32', 14 + 'newLen' => 'uint32', 15 + ), 16 + self::CONFIG_KEY_SCHEMA => array( 17 + 'changesetID' => array( 18 + 'columns' => array('changesetID'), 19 + ), 20 + ), 21 + ) + parent::getConfiguration(); 22 + } 23 + 7 24 public function getTableName() { 8 25 return 'differential_hunk'; 9 26 }
+17
src/applications/differential/storage/DifferentialHunkModern.php
··· 25 25 self::CONFIG_BINARY => array( 26 26 'data' => true, 27 27 ), 28 + self::CONFIG_COLUMN_SCHEMA => array( 29 + 'dataType' => 'bytes4', 30 + 'dataEncoding' => 'text16?', 31 + 'dataFormat' => 'bytes4', 32 + 'oldOffset' => 'uint32', 33 + 'oldLen' => 'uint32', 34 + 'newOffset' => 'uint32', 35 + 'newLen' => 'uint32', 36 + ), 37 + self::CONFIG_KEY_SCHEMA => array( 38 + 'key_changeset' => array( 39 + 'columns' => array('changesetID'), 40 + ), 41 + 'key_created' => array( 42 + 'columns' => array('dateCreated'), 43 + ), 44 + ), 28 45 ) + parent::getConfiguration(); 29 46 } 30 47
+27
src/applications/differential/storage/DifferentialRevision.php
··· 74 74 'attached' => self::SERIALIZATION_JSON, 75 75 'unsubscribed' => self::SERIALIZATION_JSON, 76 76 ), 77 + self::CONFIG_COLUMN_SCHEMA => array( 78 + 'title' => 'text255', 79 + 'originalTitle' => 'text255', 80 + 'status' => 'text32', 81 + 'summary' => 'text', 82 + 'testPlan' => 'text', 83 + 'authorPHID' => 'phid?', 84 + 'lastReviewerPHID' => 'phid?', 85 + 'lineCount' => 'uint32?', 86 + 'mailKey' => 'bytes40', 87 + 'branchName' => 'text255', 88 + 'arcanistProjectPHID' => 'phid?', 89 + 'repositoryPHID' => 'phid?', 90 + ), 91 + self::CONFIG_KEY_SCHEMA => array( 92 + 'key_phid' => null, 93 + 'phid' => array( 94 + 'columns' => array('phid'), 95 + 'unique' => true, 96 + ), 97 + 'authorPHID' => array( 98 + 'columns' => array('authorPHID', 'status'), 99 + ), 100 + 'repositoryPHID' => array( 101 + 'columns' => array('repositoryPHID'), 102 + ), 103 + ), 77 104 ) + parent::getConfiguration(); 78 105 } 79 106
+68 -1
src/applications/differential/storage/DifferentialSchemaSpec.php
··· 4 4 5 5 public function buildSchemata() { 6 6 $this->buildLiskSchemata('DifferentialDAO'); 7 - // $this->addEdgeSchemata($server, new DifferentialRevision()); 7 + 8 + $this->buildEdgeSchemata(new DifferentialRevision()); 9 + 10 + $this->buildTransactionSchema( 11 + new DifferentialTransaction(), 12 + new DifferentialTransactionComment()); 13 + 14 + $this->buildCustomFieldSchemata( 15 + new DifferentialCustomFieldStorage(), 16 + array( 17 + new DifferentialCustomFieldNumericIndex(), 18 + new DifferentialCustomFieldStringIndex(), 19 + )); 20 + 21 + $this->buildRawSchema( 22 + id(new DifferentialRevision())->getApplicationName(), 23 + DifferentialChangeset::TABLE_CACHE, 24 + array( 25 + 'id' => 'id', 26 + 'cache' => 'bytes', 27 + 'dateCreated' => 'epoch', 28 + ), 29 + array( 30 + 'PRIMARY' => array( 31 + 'columns' => array('id'), 32 + 'unique' => true, 33 + ), 34 + 'dateCreated' => array( 35 + 'columns' => array('dateCreated'), 36 + ), 37 + )); 38 + 39 + $this->buildRawSchema( 40 + id(new DifferentialRevision())->getApplicationName(), 41 + DifferentialRevision::TABLE_COMMIT, 42 + array( 43 + 'revisionID' => 'id', 44 + 'commitPHID' => 'phid', 45 + ), 46 + array( 47 + 'PRIMARY' => array( 48 + 'columns' => array('revisionID', 'commitPHID'), 49 + 'unique' => true, 50 + ), 51 + 'commitPHID' => array( 52 + 'columns' => array('commitPHID'), 53 + 'unique' => true, 54 + ), 55 + )); 56 + 57 + $this->buildRawSchema( 58 + id(new DifferentialRevision())->getApplicationName(), 59 + ArcanistDifferentialRevisionHash::TABLE_NAME, 60 + array( 61 + 'revisionID' => 'id', 62 + 'type' => 'bytes4', 63 + 'hash' => 'bytes40', 64 + ), 65 + array( 66 + 'type' => array( 67 + 'columns' => array('type', 'hash'), 68 + ), 69 + 'revisionID' => array( 70 + 'columns' => array('revisionID'), 71 + ), 72 + )); 73 + 74 + 8 75 } 9 76 10 77 }
+26
src/applications/differential/storage/DifferentialTransactionComment.php
··· 16 16 return new DifferentialTransaction(); 17 17 } 18 18 19 + public function getConfiguration() { 20 + $config = parent::getConfiguration(); 21 + $config[self::CONFIG_COLUMN_SCHEMA] = array( 22 + 'revisionPHID' => 'phid?', 23 + 'changesetID' => 'id?', 24 + 'isNewFile' => 'bool', 25 + 'lineNumber' => 'uint32', 26 + 'lineLength' => 'uint32', 27 + 'fixedState' => 'text12?', 28 + 'hasReplies' => 'bool', 29 + 'replyToCommentPHID' => 'phid?', 30 + ) + $config[self::CONFIG_COLUMN_SCHEMA]; 31 + $config[self::CONFIG_KEY_SCHEMA] = array( 32 + 'key_draft' => array( 33 + 'columns' => array('authorPHID', 'transactionPHID'), 34 + ), 35 + 'key_changeset' => array( 36 + 'columns' => array('changesetID'), 37 + ), 38 + 'key_revision' => array( 39 + 'columns' => array('revisionPHID'), 40 + ), 41 + ) + $config[self::CONFIG_KEY_SCHEMA]; 42 + return $config; 43 + } 44 + 19 45 public function shouldUseMarkupCache($field) { 20 46 // Only cache submitted comments. 21 47 return ($this->getTransactionPHID() != null);