Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | foreach ($columns as $name => $type) { | ||||
->setCharacterSet($charset) | ->setCharacterSet($charset) | ||||
->setCollation($collation) | ->setCollation($collation) | ||||
->setNullable($nullable); | ->setNullable($nullable); | ||||
$table->addColumn($column); | $table->addColumn($column); | ||||
} | } | ||||
foreach ($keys as $key_name => $key_spec) { | foreach ($keys as $key_name => $key_spec) { | ||||
if ($key_spec === null) { | |||||
// This is a subclass removing a key which Lisk expects. | |||||
continue; | |||||
} | |||||
$key = $this->newKey($key_name) | $key = $this->newKey($key_name) | ||||
->setColumnNames(idx($key_spec, 'columns', array())); | ->setColumnNames(idx($key_spec, 'columns', array())); | ||||
$table->addKey($key); | $table->addKey($key); | ||||
} | } | ||||
$database->addTable($table); | $database->addTable($table); | ||||
} | } | ||||
protected function buildEdgeSchemata(PhabricatorLiskDAO $object) {} | protected function buildEdgeSchemata(PhabricatorLiskDAO $object) { | ||||
$this->buildRawSchema( | |||||
$object->getApplicationName(), | |||||
PhabricatorEdgeConfig::TABLE_NAME_EDGE, | |||||
array( | |||||
'src' => 'phid', | |||||
'type' => 'uint32', | |||||
'dst' => 'phid', | |||||
'dateCreated' => 'epoch', | |||||
'seq' => 'uint32', | |||||
'dataID' => 'id?', | |||||
), | |||||
array( | |||||
'PRIMARY' => array( | |||||
'columns' => array('src', 'type', 'dst'), | |||||
), | |||||
)); | |||||
$this->buildRawSchema( | |||||
$object->getApplicationName(), | |||||
PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA, | |||||
array( | |||||
'id' => 'id', | |||||
'data' => 'text', | |||||
), | |||||
array( | |||||
'PRIMARY' => array( | |||||
'columns' => array('id'), | |||||
), | |||||
)); | |||||
} | |||||
protected function getDatabase($name) { | protected function getDatabase($name) { | ||||
$server = $this->getServer(); | $server = $this->getServer(); | ||||
$database = $server->getDatabase($this->getNamespacedDatabase($name)); | $database = $server->getDatabase($this->getNamespacedDatabase($name)); | ||||
if (!$database) { | if (!$database) { | ||||
$database = $this->newDatabase($name); | $database = $this->newDatabase($name); | ||||
$server->addDatabase($database); | $server->addDatabase($database); | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | switch ($data_type) { | ||||
$charset = $this->getUTF8Charset(); | $charset = $this->getUTF8Charset(); | ||||
$collation = $this->getUTF8Collation(); | $collation = $this->getUTF8Collation(); | ||||
break; | break; | ||||
case 'text32': | case 'text32': | ||||
$column_type = 'varchar(32)'; | $column_type = 'varchar(32)'; | ||||
$charset = $this->getUTF8Charset(); | $charset = $this->getUTF8Charset(); | ||||
$collation = $this->getUTF8Collation(); | $collation = $this->getUTF8Collation(); | ||||
break; | break; | ||||
case 'text20': | |||||
$column_type = 'varchar(20)'; | |||||
$charset = $this->getUTF8Charset(); | |||||
$collation = $this->getUTF8Collation(); | |||||
break; | |||||
case 'text16': | case 'text16': | ||||
$column_type = 'varchar(16)'; | $column_type = 'varchar(16)'; | ||||
$charset = $this->getUTF8Charset(); | $charset = $this->getUTF8Charset(); | ||||
$collation = $this->getUTF8Collation(); | $collation = $this->getUTF8Collation(); | ||||
break; | break; | ||||
case 'text12': | case 'text12': | ||||
$column_type = 'varchar(12)'; | $column_type = 'varchar(12)'; | ||||
$charset = $this->getUTF8Charset(); | $charset = $this->getUTF8Charset(); | ||||
Show All 31 Lines |