Generate reasonable expected schemata for Audit and Auth

Summary: Ref T1191. This fills in some more features and gets audit and auth nearly generating reasonable expected schemata.

Test Plan: See screenshots.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10500
This commit is contained in:
epriestley
2014-09-18 08:32:44 -07:00
parent fb8da6f4af
commit 0f73b15a70
16 changed files with 234 additions and 25 deletions

View File

@@ -525,10 +525,12 @@ final class PhabricatorConfigDatabaseController
$actual_coltype = $actual_column->getColumnType();
$actual_charset = $actual_column->getCharacterSet();
$actual_collation = $actual_column->getCollation();
$actual_nullable = $actual_column->getNullable();
} else {
$actual_coltype = null;
$actual_charset = null;
$actual_collation = null;
$actual_nullable = null;
}
if ($expect_column) {
@@ -536,11 +538,13 @@ final class PhabricatorConfigDatabaseController
$expect_coltype = $expect_column->getColumnType();
$expect_charset = $expect_column->getCharacterSet();
$expect_collation = $expect_column->getCollation();
$expect_nullable = $expect_column->getNullable();
} else {
$data_type = null;
$expect_coltype = null;
$expect_charset = null;
$expect_collation = null;
$expect_nullable = null;
}
@@ -580,6 +584,14 @@ final class PhabricatorConfigDatabaseController
pht('Expected Collation'),
$expect_collation,
),
array(
pht('Nullable'),
$this->getNullableString($actual_nullable),
),
array(
pht('Expected Nullable'),
$this->getNullableString($expect_nullable),
),
),
$column->getIssues());
@@ -747,4 +759,14 @@ final class PhabricatorConfigDatabaseController
return $view;
}
private function getNullableString($value) {
if ($value === null) {
return '';
} else if ($value === true) {
return pht('Yes');
} else {
return pht('No');
}
}
}