1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00
phorge-phorge/src/applications/differential/storage/DifferentialSchemaSpec.php

65 lines
1.5 KiB
PHP
Raw Normal View History

<?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'),
),
));
}
}