From 9be2bf211904deb65b164d678d032a556bb494e9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 28 Sep 2014 15:12:41 -0700 Subject: [PATCH] Generate expected schemata for Releeph Summary: Ref T1191. - This drops two tables. - Both tables were migrated to transactions a very long time ago and no longer have readers or writers. Test Plan: Saw ~150 fewer warnings. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T1191 Differential Revision: https://secure.phabricator.com/D10576 --- .../20140926.schema.01.droprelev.sql | 1 + .../20140926.schema.02.droprelreqev.sql | 1 + src/__phutil_library_map__.php | 2 ++ .../releeph/storage/ReleephBranch.php | 20 +++++++++++++++ .../releeph/storage/ReleephProject.php | 11 ++++++++ .../releeph/storage/ReleephRequest.php | 25 +++++++++++++++++++ .../releeph/storage/ReleephSchemaSpec.php | 20 +++++++++++++++ 7 files changed, 80 insertions(+) create mode 100644 resources/sql/autopatches/20140926.schema.01.droprelev.sql create mode 100644 resources/sql/autopatches/20140926.schema.02.droprelreqev.sql create mode 100644 src/applications/releeph/storage/ReleephSchemaSpec.php diff --git a/resources/sql/autopatches/20140926.schema.01.droprelev.sql b/resources/sql/autopatches/20140926.schema.01.droprelev.sql new file mode 100644 index 0000000000..7542e2b209 --- /dev/null +++ b/resources/sql/autopatches/20140926.schema.01.droprelev.sql @@ -0,0 +1 @@ +DROP TABLE {$NAMESPACE}_releeph.releeph_event; diff --git a/resources/sql/autopatches/20140926.schema.02.droprelreqev.sql b/resources/sql/autopatches/20140926.schema.02.droprelreqev.sql new file mode 100644 index 0000000000..de0218ef2d --- /dev/null +++ b/resources/sql/autopatches/20140926.schema.02.droprelreqev.sql @@ -0,0 +1 @@ +DROP TABLE {$NAMESPACE}_releeph.releeph_requestevent; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index bd49877f45..89f3334e51 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2802,6 +2802,7 @@ phutil_register_library_map(array( 'ReleephRequestViewController' => 'applications/releeph/controller/request/ReleephRequestViewController.php', 'ReleephRequestorFieldSpecification' => 'applications/releeph/field/specification/ReleephRequestorFieldSpecification.php', 'ReleephRevisionFieldSpecification' => 'applications/releeph/field/specification/ReleephRevisionFieldSpecification.php', + 'ReleephSchemaSpec' => 'applications/releeph/storage/ReleephSchemaSpec.php', 'ReleephSeverityFieldSpecification' => 'applications/releeph/field/specification/ReleephSeverityFieldSpecification.php', 'ReleephSummaryFieldSpecification' => 'applications/releeph/field/specification/ReleephSummaryFieldSpecification.php', 'ReleephWorkCanPushConduitAPIMethod' => 'applications/releeph/conduit/work/ReleephWorkCanPushConduitAPIMethod.php', @@ -5894,6 +5895,7 @@ phutil_register_library_map(array( 'ReleephRequestViewController' => 'ReleephBranchController', 'ReleephRequestorFieldSpecification' => 'ReleephFieldSpecification', 'ReleephRevisionFieldSpecification' => 'ReleephFieldSpecification', + 'ReleephSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'ReleephSeverityFieldSpecification' => 'ReleephLevelFieldSpecification', 'ReleephSummaryFieldSpecification' => 'ReleephFieldSpecification', 'ReleephWorkCanPushConduitAPIMethod' => 'ReleephConduitAPIMethod', diff --git a/src/applications/releeph/storage/ReleephBranch.php b/src/applications/releeph/storage/ReleephBranch.php index 647406f1a2..f6cb1834c9 100644 --- a/src/applications/releeph/storage/ReleephBranch.php +++ b/src/applications/releeph/storage/ReleephBranch.php @@ -29,6 +29,26 @@ final class ReleephBranch extends ReleephDAO self::CONFIG_SERIALIZATION => array( 'details' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'basename' => 'text64', + 'isActive' => 'bool', + 'symbolicName' => 'text64?', + 'name' => 'text128', + ), + self::CONFIG_KEY_SCHEMA => array( + 'releephProjectID' => array( + 'columns' => array('releephProjectID', 'symbolicName'), + 'unique' => true, + ), + 'releephProjectID_2' => array( + 'columns' => array('releephProjectID', 'basename'), + 'unique' => true, + ), + 'releephProjectID_name' => array( + 'columns' => array('releephProjectID', 'name'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/releeph/storage/ReleephProject.php b/src/applications/releeph/storage/ReleephProject.php index f52b847eb0..0465541c60 100644 --- a/src/applications/releeph/storage/ReleephProject.php +++ b/src/applications/releeph/storage/ReleephProject.php @@ -29,6 +29,17 @@ final class ReleephProject extends ReleephDAO self::CONFIG_SERIALIZATION => array( 'details' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'trunkBranch' => 'text255', + 'isActive' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'projectName' => array( + 'columns' => array('name'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php index 2c495099b6..09cc903d48 100644 --- a/src/applications/releeph/storage/ReleephRequest.php +++ b/src/applications/releeph/storage/ReleephRequest.php @@ -153,6 +153,31 @@ final class ReleephRequest extends ReleephDAO 'details' => self::SERIALIZATION_JSON, 'userIntents' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'summary' => 'text', + 'requstCommitPHID' => 'phid?', + 'commitIdentifier' => 'text40', + 'pickStatus' => 'uint32', + 'inBranch' => 'bool', + 'mailKey' => 'bytes20', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'requestIdentifierBranch' => array( + 'columns' => array('requestCommitPHID', 'branchID'), + 'unique' => true, + ), + 'branchID' => array( + 'columns' => array('branchID'), + ), + 'key_requestedObject' => array( + 'columns' => array('requestedObjectPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/releeph/storage/ReleephSchemaSpec.php b/src/applications/releeph/storage/ReleephSchemaSpec.php new file mode 100644 index 0000000000..346c4355fc --- /dev/null +++ b/src/applications/releeph/storage/ReleephSchemaSpec.php @@ -0,0 +1,20 @@ +buildLiskSchemata('ReleephDAO'); + + $this->buildTransactionSchema( + new ReleephProductTransaction()); + + $this->buildTransactionSchema( + new ReleephBranchTransaction()); + + $this->buildTransactionSchema( + new ReleephRequestTransaction(), + new ReleephRequestTransactionComment()); + } + +}