1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Add custom field storage to Projects

Summary: Ref T4010. Adds storage and indexes for custom fields. These tables are the same as people/maniphest/differential.

Test Plan: Ran `bin/storage upgrade`.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T4010

Differential Revision: https://secure.phabricator.com/D7369
This commit is contained in:
epriestley 2013-10-21 17:01:13 -07:00
parent 8994a81b35
commit cf1c06e157
5 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,29 @@
CREATE TABLE {$NAMESPACE}_project.project_customfieldstorage (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
fieldIndex CHAR(12) NOT NULL COLLATE utf8_bin,
fieldValue LONGTEXT NOT NULL,
UNIQUE KEY (objectPHID, fieldIndex)
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_project.project_customfieldstringindex (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
indexKey VARCHAR(12) NOT NULL COLLATE utf8_bin,
indexValue LONGTEXT NOT NULL COLLATE utf8_general_ci,
KEY `key_join` (objectPHID, indexKey, indexValue(64)),
KEY `key_find` (indexKey, indexValue(64))
) ENGINE=InnoDB, COLLATE utf8_general_ci;
CREATE TABLE {$NAMESPACE}_project.project_customfieldnumericindex (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin,
indexKey VARCHAR(12) NOT NULL COLLATE utf8_bin,
indexValue BIGINT NOT NULL,
KEY `key_join` (objectPHID, indexKey, indexValue),
KEY `key_find` (indexKey, indexValue)
) ENGINE=InnoDB, COLLATE utf8_general_ci;

View file

@ -0,0 +1,11 @@
<?php
final class PhabricatorProjectCustomFieldNumericIndex
extends PhabricatorCustomFieldNumericIndexStorage {
public function getApplicationName() {
return 'project';
}
}

View file

@ -0,0 +1,11 @@
<?php
final class PhabricatorProjectCustomFieldStorage
extends PhabricatorCustomFieldStorage {
public function getApplicationName() {
return 'project';
}
}

View file

@ -0,0 +1,11 @@
<?php
final class PhabricatorProjectCustomFieldStringIndex
extends PhabricatorCustomFieldStringIndexStorage {
public function getApplicationName() {
return 'project';
}
}

View file

@ -1684,6 +1684,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
'type' => 'php',
'name' => $this->getPatchPath('20130926.dinline.php'),
),
'20131020.pcustom.sql' => array(
'type' => 'sql',
'name' => $this->getPatchPath('20131020.pcustom.sql'),
),
);
}
}