diff --git a/resources/sql/autopatches/20140926.schema.05.dropprojaffil.sql b/resources/sql/autopatches/20140926.schema.05.dropprojaffil.sql new file mode 100644 index 0000000000..fca4b35db3 --- /dev/null +++ b/resources/sql/autopatches/20140926.schema.05.dropprojaffil.sql @@ -0,0 +1 @@ +DROP TABLE {$NAMESPACE}_project.project_affiliation; diff --git a/resources/sql/autopatches/20140926.schema.06.dropsubproject.sql b/resources/sql/autopatches/20140926.schema.06.dropsubproject.sql new file mode 100644 index 0000000000..9049f82329 --- /dev/null +++ b/resources/sql/autopatches/20140926.schema.06.dropsubproject.sql @@ -0,0 +1 @@ +DROP TABLE {$NAMESPACE}_project.project_subproject; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index db99852be3..6fd63c0ff4 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2052,6 +2052,7 @@ phutil_register_library_map(array( 'PhabricatorProjectProjectHasObjectEdgeType' => 'applications/project/edge/PhabricatorProjectProjectHasObjectEdgeType.php', 'PhabricatorProjectProjectPHIDType' => 'applications/project/phid/PhabricatorProjectProjectPHIDType.php', 'PhabricatorProjectQuery' => 'applications/project/query/PhabricatorProjectQuery.php', + 'PhabricatorProjectSchemaSpec' => 'applications/project/storage/PhabricatorProjectSchemaSpec.php', 'PhabricatorProjectSearchEngine' => 'applications/project/query/PhabricatorProjectSearchEngine.php', 'PhabricatorProjectSearchIndexer' => 'applications/project/search/PhabricatorProjectSearchIndexer.php', 'PhabricatorProjectSlug' => 'applications/project/storage/PhabricatorProjectSlug.php', @@ -5018,6 +5019,7 @@ phutil_register_library_map(array( 'PhabricatorProjectProjectHasObjectEdgeType' => 'PhabricatorEdgeType', 'PhabricatorProjectProjectPHIDType' => 'PhabricatorPHIDType', 'PhabricatorProjectQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'PhabricatorProjectSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorProjectSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorProjectSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorProjectSlug' => 'PhabricatorProjectDAO', diff --git a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php index 52463ad4b8..ce8425d987 100644 --- a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php +++ b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php @@ -170,6 +170,7 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject { array( 'PRIMARY' => array( 'columns' => array('counterName'), + 'unique' => true, ), )); } diff --git a/src/applications/maniphest/storage/ManiphestTaskSubscriber.php b/src/applications/maniphest/storage/ManiphestTaskSubscriber.php index 54e1cce418..68a2a58ac8 100644 --- a/src/applications/maniphest/storage/ManiphestTaskSubscriber.php +++ b/src/applications/maniphest/storage/ManiphestTaskSubscriber.php @@ -9,6 +9,19 @@ final class ManiphestTaskSubscriber extends ManiphestDAO { return array( self::CONFIG_IDS => self::IDS_MANUAL, self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'id' => null, + ), + self::CONFIG_KEY_SCHEMA => array( + 'PRIMARY' => array( + 'columns' => array('subscriberPHID', 'taskPHID'), + 'unique' => true, + ), + 'taskPHID' => array( + 'columns' => array('taskPHID', 'subscriberPHID'), + 'unique' => true, + ), + ), ); } diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index e8f2365add..afacd65fcf 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -121,6 +121,37 @@ final class PhabricatorProject extends PhabricatorProjectDAO self::CONFIG_SERIALIZATION => array( 'subprojectPHIDs' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'status' => 'text32', + 'phrictionSlug' => 'text128?', + 'joinPolicy' => 'policy', + 'isMembershipLocked' => 'bool', + 'profileImagePHID' => 'phid?', + 'icon' => 'text32', + 'color' => 'text32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'key_icon' => array( + 'columns' => array('icon'), + ), + 'key_color' => array( + 'columns' => array('color'), + ), + 'phrictionSlug' => array( + 'columns' => array('phrictionSlug'), + 'unique' => true, + ), + 'name' => array( + 'columns' => array('name'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php index e37a28dce3..5626d0e883 100644 --- a/src/applications/project/storage/PhabricatorProjectColumn.php +++ b/src/applications/project/storage/PhabricatorProjectColumn.php @@ -33,6 +33,19 @@ final class PhabricatorProjectColumn self::CONFIG_SERIALIZATION => array( 'properties' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'status' => 'uint32', + 'sequence' => 'uint32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_status' => array( + 'columns' => array('projectPHID', 'status', 'sequence'), + ), + 'key_sequence' => array( + 'columns' => array('projectPHID', 'sequence'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/project/storage/PhabricatorProjectColumnPosition.php b/src/applications/project/storage/PhabricatorProjectColumnPosition.php index 0f84cb532f..835692dadd 100644 --- a/src/applications/project/storage/PhabricatorProjectColumnPosition.php +++ b/src/applications/project/storage/PhabricatorProjectColumnPosition.php @@ -13,6 +13,21 @@ final class PhabricatorProjectColumnPosition extends PhabricatorProjectDAO public function getConfiguration() { return array( self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'sequence' => 'uint32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'boardPHID' => array( + 'columns' => array('boardPHID', 'columnPHID', 'objectPHID'), + 'unique' => true, + ), + 'objectPHID' => array( + 'columns' => array('objectPHID', 'boardPHID'), + ), + 'boardPHID_2' => array( + 'columns' => array('boardPHID', 'columnPHID', 'sequence'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/project/storage/PhabricatorProjectSchemaSpec.php b/src/applications/project/storage/PhabricatorProjectSchemaSpec.php new file mode 100644 index 0000000000..0abd429f5e --- /dev/null +++ b/src/applications/project/storage/PhabricatorProjectSchemaSpec.php @@ -0,0 +1,48 @@ +buildLiskSchemata('PhabricatorProjectDAO'); + + $this->buildEdgeSchemata(new PhabricatorProject()); + + $this->buildTransactionSchema( + new PhabricatorProjectTransaction()); + + $this->buildCustomFieldSchemata( + new PhabricatorProjectCustomFieldStorage(), + array( + new PhabricatorProjectCustomFieldNumericIndex(), + new PhabricatorProjectCustomFieldStringIndex(), + )); + + $this->buildTransactionSchema( + new PhabricatorProjectColumnTransaction()); + + $this->buildRawSchema( + id(new PhabricatorProject())->getApplicationName(), + PhabricatorProject::TABLE_DATASOURCE_TOKEN, + array( + 'id' => 'id', + 'projectID' => 'id', + 'token' => 'text128', + ), + array( + 'PRIMARY' => array( + 'columns' => array('id'), + 'unique' => true, + ), + 'token' => array( + 'columns' => array('token', 'projectID'), + 'unique' => true, + ), + 'projectID' => array( + 'columns' => array('projectID'), + ), + )); + + + } + +} diff --git a/src/applications/project/storage/PhabricatorProjectSlug.php b/src/applications/project/storage/PhabricatorProjectSlug.php index 8e1efba4c0..1f13ba6635 100644 --- a/src/applications/project/storage/PhabricatorProjectSlug.php +++ b/src/applications/project/storage/PhabricatorProjectSlug.php @@ -5,4 +5,21 @@ final class PhabricatorProjectSlug extends PhabricatorProjectDAO { protected $slug; protected $projectPHID; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'slug' => 'text128', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_slug' => array( + 'columns' => array('slug'), + 'unique' => true, + ), + 'key_projectPHID' => array( + 'columns' => array('projectPHID'), + ), + ), + ) + parent::getConfiguration(); + } + }