Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | $this->buildRawSchema( | ||||
), | ), | ||||
array( | array( | ||||
'PRIMARY' => array( | 'PRIMARY' => array( | ||||
'columns' => array('id'), | 'columns' => array('id'), | ||||
), | ), | ||||
)); | )); | ||||
} | } | ||||
public function buildCounterSchema(PhabricatorLiskDAO $object) { | |||||
$this->buildRawSchema( | |||||
$object->getApplicationName(), | |||||
PhabricatorLiskDAO::COUNTER_TABLE_NAME, | |||||
array( | |||||
'counterName' => 'text32', | |||||
'counterValue' => 'id64', | |||||
), | |||||
array( | |||||
'PRIMARY' => array( | |||||
'columns' => array('counterName'), | |||||
), | |||||
)); | |||||
} | |||||
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 120 Lines • ▼ Show 20 Lines | switch ($data_type) { | ||||
case 'text': | case 'text': | ||||
$column_type = 'longtext'; | $column_type = 'longtext'; | ||||
$charset = $this->getUTF8Charset(); | $charset = $this->getUTF8Charset(); | ||||
$collation = $this->getUTF8Collation(); | $collation = $this->getUTF8Collation(); | ||||
break; | break; | ||||
case 'bool': | case 'bool': | ||||
$column_type = 'tinyint(1)'; | $column_type = 'tinyint(1)'; | ||||
break; | break; | ||||
case 'double': | |||||
$column_type = 'double'; | |||||
break; | |||||
default: | default: | ||||
$column_type = pht('<unknown>'); | $column_type = pht('<unknown>'); | ||||
$charset = pht('<unknown>'); | $charset = pht('<unknown>'); | ||||
$collation = pht('<unknown>'); | $collation = pht('<unknown>'); | ||||
break; | break; | ||||
} | } | ||||
return array($column_type, $charset, $collation, $nullable); | return array($column_type, $charset, $collation, $nullable); | ||||
} | } | ||||
} | } |