diff --git a/resources/sql/autopatches/20170914.ref.01.position.sql b/resources/sql/autopatches/20170914.ref.01.position.sql new file mode 100644 index 0000000000..2d0a505d17 --- /dev/null +++ b/resources/sql/autopatches/20170914.ref.01.position.sql @@ -0,0 +1,6 @@ +CREATE TABLE {$NAMESPACE}_repository.repository_refposition ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + cursorID INT UNSIGNED NOT NULL, + commitIdentifier VARCHAR(40) NOT NULL COLLATE {$COLLATE_TEXT}, + isClosed BOOL NOT NULL +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 282e5aaf62..c535d46322 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3863,6 +3863,7 @@ phutil_register_library_map(array( 'PhabricatorRepositoryRefCursorPHIDType' => 'applications/repository/phid/PhabricatorRepositoryRefCursorPHIDType.php', 'PhabricatorRepositoryRefCursorQuery' => 'applications/repository/query/PhabricatorRepositoryRefCursorQuery.php', 'PhabricatorRepositoryRefEngine' => 'applications/repository/engine/PhabricatorRepositoryRefEngine.php', + 'PhabricatorRepositoryRefPosition' => 'applications/repository/storage/PhabricatorRepositoryRefPosition.php', 'PhabricatorRepositoryRepositoryPHIDType' => 'applications/repository/phid/PhabricatorRepositoryRepositoryPHIDType.php', 'PhabricatorRepositorySchemaSpec' => 'applications/repository/storage/PhabricatorRepositorySchemaSpec.php', 'PhabricatorRepositorySearchEngine' => 'applications/repository/query/PhabricatorRepositorySearchEngine.php', @@ -9434,6 +9435,7 @@ phutil_register_library_map(array( 'PhabricatorRepositoryRefCursorPHIDType' => 'PhabricatorPHIDType', 'PhabricatorRepositoryRefCursorQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorRepositoryRefEngine' => 'PhabricatorRepositoryEngine', + 'PhabricatorRepositoryRefPosition' => 'PhabricatorRepositoryDAO', 'PhabricatorRepositoryRepositoryPHIDType' => 'PhabricatorPHIDType', 'PhabricatorRepositorySchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorRepositorySearchEngine' => 'PhabricatorApplicationSearchEngine', diff --git a/src/applications/repository/storage/PhabricatorRepositoryRefPosition.php b/src/applications/repository/storage/PhabricatorRepositoryRefPosition.php new file mode 100644 index 0000000000..838037b1a0 --- /dev/null +++ b/src/applications/repository/storage/PhabricatorRepositoryRefPosition.php @@ -0,0 +1,26 @@ + false, + self::CONFIG_COLUMN_SCHEMA => array( + 'commitIdentifier' => 'text40', + 'isClosed' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_position' => array( + 'columns' => array('cursorID', 'commitIdentifier'), + 'unique' => true, + ), + ), + ) + parent::getConfiguration(); + } + +}