Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | protected function buildTransactionSchema( | ||||
PhabricatorApplicationTransactionComment $comment = null) { | PhabricatorApplicationTransactionComment $comment = null) { | ||||
$this->buildLiskObjectSchema($xaction); | $this->buildLiskObjectSchema($xaction); | ||||
if ($comment) { | if ($comment) { | ||||
$this->buildLiskObjectSchema($comment); | $this->buildLiskObjectSchema($comment); | ||||
} | } | ||||
} | } | ||||
protected function buildCustomFieldSchemata( | |||||
PhabricatorLiskDAO $storage, | |||||
array $indexes) { | |||||
$this->buildLiskObjectSchema($storage); | |||||
foreach ($indexes as $index) { | |||||
$this->buildLiskObjectSchema($index); | |||||
} | |||||
} | |||||
private function buildLiskObjectSchema(PhabricatorLiskDAO $object) { | private function buildLiskObjectSchema(PhabricatorLiskDAO $object) { | ||||
$this->buildRawSchema( | $this->buildRawSchema( | ||||
$object->getApplicationName(), | $object->getApplicationName(), | ||||
$object->getTableName(), | $object->getTableName(), | ||||
$object->getSchemaColumns(), | $object->getSchemaColumns(), | ||||
$object->getSchemaKeys()); | $object->getSchemaKeys()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | $this->buildRawSchema( | ||||
'dst' => 'phid', | 'dst' => 'phid', | ||||
'dateCreated' => 'epoch', | 'dateCreated' => 'epoch', | ||||
'seq' => 'uint32', | 'seq' => 'uint32', | ||||
'dataID' => 'id?', | 'dataID' => 'id?', | ||||
), | ), | ||||
array( | array( | ||||
'PRIMARY' => array( | 'PRIMARY' => array( | ||||
'columns' => array('src', 'type', 'dst'), | 'columns' => array('src', 'type', 'dst'), | ||||
'unique' => true, | |||||
), | |||||
'src' => array( | |||||
'columns' => array('src', 'type', 'dateCreated', 'seq'), | |||||
), | ), | ||||
)); | )); | ||||
$this->buildRawSchema( | $this->buildRawSchema( | ||||
$object->getApplicationName(), | $object->getApplicationName(), | ||||
PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA, | PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA, | ||||
array( | array( | ||||
'id' => 'id', | 'id' => 'id', | ||||
'data' => 'text', | 'data' => 'text', | ||||
), | ), | ||||
array( | array( | ||||
'PRIMARY' => array( | 'PRIMARY' => array( | ||||
'columns' => array('id'), | 'columns' => array('id'), | ||||
'unique' => true, | |||||
), | ), | ||||
)); | )); | ||||
} | } | ||||
public function buildCounterSchema(PhabricatorLiskDAO $object) { | public function buildCounterSchema(PhabricatorLiskDAO $object) { | ||||
$this->buildRawSchema( | $this->buildRawSchema( | ||||
$object->getApplicationName(), | $object->getApplicationName(), | ||||
PhabricatorLiskDAO::COUNTER_TABLE_NAME, | PhabricatorLiskDAO::COUNTER_TABLE_NAME, | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | switch ($data_type) { | ||||
case 'epoch': | case 'epoch': | ||||
case 'uint32': | case 'uint32': | ||||
$column_type = 'int(10) unsigned'; | $column_type = 'int(10) unsigned'; | ||||
break; | break; | ||||
case 'id64': | case 'id64': | ||||
case 'uint64': | case 'uint64': | ||||
$column_type = 'bigint(20) unsigned'; | $column_type = 'bigint(20) unsigned'; | ||||
break; | break; | ||||
case 'sint64': | |||||
$column_type = 'bigint(20)'; | |||||
break; | |||||
case 'phid': | case 'phid': | ||||
case 'policy'; | case 'policy'; | ||||
$column_type = 'varchar(64)'; | $column_type = 'varchar(64)'; | ||||
$charset = 'binary'; | $charset = 'binary'; | ||||
$collation = 'binary'; | $collation = 'binary'; | ||||
break; | break; | ||||
case 'bytes40': | case 'bytes40': | ||||
$column_type = 'char(40)'; | $column_type = 'char(40)'; | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |