Page MenuHomePhabricator

D18602.diff
No OneTemporary

D18602.diff

diff --git a/resources/sql/autopatches/20170914.ref.01.position.sql b/resources/sql/autopatches/20170914.ref.01.position.sql
new file mode 100644
--- /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
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3863,6 +3863,7 @@
'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 @@
'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
--- /dev/null
+++ b/src/applications/repository/storage/PhabricatorRepositoryRefPosition.php
@@ -0,0 +1,26 @@
+<?php
+
+final class PhabricatorRepositoryRefPosition
+ extends PhabricatorRepositoryDAO {
+
+ protected $cursorID;
+ protected $commitIdentifier;
+ protected $isClosed = 0;
+
+ protected function getConfiguration() {
+ return array(
+ self::CONFIG_TIMESTAMPS => 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();
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 12:55 AM (6 h, 19 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6776495
Default Alt Text
D18602.diff (2 KB)

Event Timeline