@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
1<?php
2
3abstract class PhabricatorCustomFieldStringIndexStorage
4 extends PhabricatorCustomFieldIndexStorage {
5
6 protected function getConfiguration() {
7 return array(
8 self::CONFIG_COLUMN_SCHEMA => array(
9 'indexKey' => 'bytes12',
10 'indexValue' => 'sort',
11 ),
12 self::CONFIG_KEY_SCHEMA => array(
13 'key_join' => array(
14 'columns' => array('objectPHID', 'indexKey', 'indexValue(64)'),
15 ),
16 'key_find' => array(
17 'columns' => array('indexKey', 'indexValue(64)'),
18 ),
19 ),
20 ) + parent::getConfiguration();
21 }
22
23 public function formatForInsert(AphrontDatabaseConnection $conn) {
24 return qsprintf(
25 $conn,
26 '(%s, %s, %s)',
27 $this->getObjectPHID(),
28 $this->getIndexKey(),
29 $this->getIndexValue());
30 }
31
32 public function getIndexValueType() {
33 return 'string';
34 }
35
36}