1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 11:12:42 +01:00
phorge-phorge/src/applications/differential/storage/DifferentialSchemaSpec.php
epriestley 8fa8415c07 Automatically build all Lisk schemata
Summary:
Ref T1191. Now that the whole database is covered, we don't need to do as much work to build expected schemata. Doing them database-by-database was helpful in converting, but is just reudndant work now.

Instead of requiring every application to build its Lisk objects, just build all Lisk objects.

I removed `harbormaster.lisk_counter` because it is unused.

It would be nice to autogenerate edge schemata, too, but that's a little trickier.

Test Plan: Database setup issues are all green.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley, hach-que

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10620
2014-10-02 09:51:20 -07:00

64 lines
1.5 KiB
PHP

<?php
final class DifferentialSchemaSpec extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildEdgeSchemata(new DifferentialRevision());
$this->buildRawSchema(
id(new DifferentialRevision())->getApplicationName(),
DifferentialChangeset::TABLE_CACHE,
array(
'id' => 'id',
'cache' => 'bytes',
'dateCreated' => 'epoch',
),
array(
'PRIMARY' => array(
'columns' => array('id'),
'unique' => true,
),
'dateCreated' => array(
'columns' => array('dateCreated'),
),
));
$this->buildRawSchema(
id(new DifferentialRevision())->getApplicationName(),
DifferentialRevision::TABLE_COMMIT,
array(
'revisionID' => 'id',
'commitPHID' => 'phid',
),
array(
'PRIMARY' => array(
'columns' => array('revisionID', 'commitPHID'),
'unique' => true,
),
'commitPHID' => array(
'columns' => array('commitPHID'),
'unique' => true,
),
));
$this->buildRawSchema(
id(new DifferentialRevision())->getApplicationName(),
ArcanistDifferentialRevisionHash::TABLE_NAME,
array(
'revisionID' => 'id',
'type' => 'bytes4',
'hash' => 'bytes40',
),
array(
'type' => array(
'columns' => array('type', 'hash'),
),
'revisionID' => array(
'columns' => array('revisionID'),
),
));
}
}