@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

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

+66
+29
resources/sql/patches/20131020.pcustom.sql
··· 1 + CREATE TABLE {$NAMESPACE}_project.project_customfieldstorage ( 2 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 3 + objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin, 4 + fieldIndex CHAR(12) NOT NULL COLLATE utf8_bin, 5 + fieldValue LONGTEXT NOT NULL, 6 + UNIQUE KEY (objectPHID, fieldIndex) 7 + ) ENGINE=InnoDB, COLLATE utf8_general_ci; 8 + 9 + CREATE TABLE {$NAMESPACE}_project.project_customfieldstringindex ( 10 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 11 + objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin, 12 + indexKey VARCHAR(12) NOT NULL COLLATE utf8_bin, 13 + indexValue LONGTEXT NOT NULL COLLATE utf8_general_ci, 14 + 15 + KEY `key_join` (objectPHID, indexKey, indexValue(64)), 16 + KEY `key_find` (indexKey, indexValue(64)) 17 + 18 + ) ENGINE=InnoDB, COLLATE utf8_general_ci; 19 + 20 + CREATE TABLE {$NAMESPACE}_project.project_customfieldnumericindex ( 21 + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, 22 + objectPHID VARCHAR(64) NOT NULL COLLATE utf8_bin, 23 + indexKey VARCHAR(12) NOT NULL COLLATE utf8_bin, 24 + indexValue BIGINT NOT NULL, 25 + 26 + KEY `key_join` (objectPHID, indexKey, indexValue), 27 + KEY `key_find` (indexKey, indexValue) 28 + 29 + ) ENGINE=InnoDB, COLLATE utf8_general_ci;
+11
src/applications/project/storage/PhabricatorProjectCustomFieldNumericIndex.php
··· 1 + <?php 2 + 3 + final class PhabricatorProjectCustomFieldNumericIndex 4 + extends PhabricatorCustomFieldNumericIndexStorage { 5 + 6 + public function getApplicationName() { 7 + return 'project'; 8 + } 9 + 10 + } 11 +
+11
src/applications/project/storage/PhabricatorProjectCustomFieldStorage.php
··· 1 + <?php 2 + 3 + final class PhabricatorProjectCustomFieldStorage 4 + extends PhabricatorCustomFieldStorage { 5 + 6 + public function getApplicationName() { 7 + return 'project'; 8 + } 9 + 10 + } 11 +
+11
src/applications/project/storage/PhabricatorProjectCustomFieldStringIndex.php
··· 1 + <?php 2 + 3 + final class PhabricatorProjectCustomFieldStringIndex 4 + extends PhabricatorCustomFieldStringIndexStorage { 5 + 6 + public function getApplicationName() { 7 + return 'project'; 8 + } 9 + 10 + } 11 +
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1684 1684 'type' => 'php', 1685 1685 'name' => $this->getPatchPath('20130926.dinline.php'), 1686 1686 ), 1687 + '20131020.pcustom.sql' => array( 1688 + 'type' => 'sql', 1689 + 'name' => $this->getPatchPath('20131020.pcustom.sql'), 1690 + ), 1687 1691 ); 1688 1692 } 1689 1693 }