1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42: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:
epriestley 2017-09-15 08:34:20 -07:00
parent 782b18e7e2
commit 5cf62f86d7
4 changed files with 8 additions and 5 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_repository.repository_refcursor
DROP COLUMN commitIdentifier;

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_repository.repository_refcursor
DROP COLUMN isClosed;

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_repository.repository_refcursor
ADD UNIQUE KEY `key_ref` (repositoryPHID, refType, refNameHash);

View file

@ -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();