Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | abstract class PhabricatorConfigSchemaSpec extends Phobject { | ||||
public function getServer() { | public function getServer() { | ||||
return $this->server; | return $this->server; | ||||
} | } | ||||
abstract public function buildSchemata(); | abstract public function buildSchemata(); | ||||
protected function buildLiskObjectSchema(PhabricatorLiskDAO $object) { | protected function buildLiskObjectSchema(PhabricatorLiskDAO $object) { | ||||
$this->buildRawSchema( | $this->buildRawSchema( | ||||
$object->getApplicationName(), | $object->getRealApplicationName(), | ||||
$object->getTableName(), | $object->getTableName(), | ||||
$object->getSchemaColumns(), | $object->getSchemaColumns(), | ||||
$object->getSchemaKeys()); | $object->getSchemaKeys()); | ||||
} | } | ||||
protected function buildRawSchema( | protected function buildRawSchema( | ||||
$database_name, | $database_name, | ||||
$table_name, | $table_name, | ||||
Show All 37 Lines | foreach ($keys as $key_name => $key_spec) { | ||||
$table->addKey($key); | $table->addKey($key); | ||||
} | } | ||||
$database->addTable($table); | $database->addTable($table); | ||||
} | } | ||||
protected function buildEdgeSchemata(PhabricatorLiskDAO $object) { | protected function buildEdgeSchemata(PhabricatorLiskDAO $object) { | ||||
$this->buildRawSchema( | $this->buildRawSchema( | ||||
$object->getApplicationName(), | $object->getRealApplicationName(), | ||||
PhabricatorEdgeConfig::TABLE_NAME_EDGE, | PhabricatorEdgeConfig::TABLE_NAME_EDGE, | ||||
array( | array( | ||||
'src' => 'phid', | 'src' => 'phid', | ||||
'type' => 'uint32', | 'type' => 'uint32', | ||||
'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, | 'unique' => true, | ||||
), | ), | ||||
'src' => array( | 'src' => array( | ||||
'columns' => array('src', 'type', 'dateCreated', 'seq'), | 'columns' => array('src', 'type', 'dateCreated', 'seq'), | ||||
), | ), | ||||
'key_dst' => array( | 'key_dst' => array( | ||||
'columns' => array('dst', 'type', 'src'), | 'columns' => array('dst', 'type', 'src'), | ||||
'unique' => true, | 'unique' => true, | ||||
), | ), | ||||
)); | )); | ||||
$this->buildRawSchema( | $this->buildRawSchema( | ||||
$object->getApplicationName(), | $object->getRealApplicationName(), | ||||
PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA, | PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA, | ||||
array( | array( | ||||
'id' => 'auto', | 'id' => 'auto', | ||||
'data' => 'text', | 'data' => 'text', | ||||
), | ), | ||||
array( | array( | ||||
'PRIMARY' => array( | 'PRIMARY' => array( | ||||
'columns' => array('id'), | 'columns' => array('id'), | ||||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |