mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Remove obsolete columns from RefCursor table
Summary: Ref T11823. This change isn't standalone, but prepares for the more involved code change by dropping obsolete columns from the RefCursor table and adding the unique key we need to prevent the ambiguous/duplicate refs issue. This data was moved to the RefPosition table in D18612. Test Plan: Ran storage upgrade. See next revision for more substantial testing of this change series. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T11823 Differential Revision: https://secure.phabricator.com/D18613
This commit is contained in:
parent
782b18e7e2
commit
5cf62f86d7
4 changed files with 8 additions and 5 deletions
2
resources/sql/autopatches/20170915.ref.02.drop.id.sql
Normal file
2
resources/sql/autopatches/20170915.ref.02.drop.id.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE {$NAMESPACE}_repository.repository_refcursor
|
||||
DROP COLUMN commitIdentifier;
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE {$NAMESPACE}_repository.repository_refcursor
|
||||
DROP COLUMN isClosed;
|
2
resources/sql/autopatches/20170915.ref.04.uniq.sql
Normal file
2
resources/sql/autopatches/20170915.ref.04.uniq.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE {$NAMESPACE}_repository.repository_refcursor
|
||||
ADD UNIQUE KEY `key_ref` (repositoryPHID, refType, refNameHash);
|
|
@ -19,8 +19,6 @@ final class PhabricatorRepositoryRefCursor
|
|||
protected $refNameHash;
|
||||
protected $refNameRaw;
|
||||
protected $refNameEncoding;
|
||||
protected $commitIdentifier;
|
||||
protected $isClosed = 0;
|
||||
|
||||
private $repository = self::ATTACHABLE;
|
||||
|
||||
|
@ -34,13 +32,12 @@ final class PhabricatorRepositoryRefCursor
|
|||
self::CONFIG_COLUMN_SCHEMA => array(
|
||||
'refType' => 'text32',
|
||||
'refNameHash' => 'bytes12',
|
||||
'commitIdentifier' => 'text40',
|
||||
'refNameEncoding' => 'text16?',
|
||||
'isClosed' => 'bool',
|
||||
),
|
||||
self::CONFIG_KEY_SCHEMA => array(
|
||||
'key_cursor' => array(
|
||||
'key_ref' => array(
|
||||
'columns' => array('repositoryPHID', 'refType', 'refNameHash'),
|
||||
'unique' => true,
|
||||
),
|
||||
),
|
||||
) + parent::getConfiguration();
|
||||
|
|
Loading…
Reference in a new issue