1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00
phorge-phorge/src/infrastructure/storage/lisk
epriestley 000760b645 Do a better job of handling spec errors during schema adjustment
Summary:
Ref T1191. Currently if a developer forgot to specify a column type, `storage adjust` aborts explosively mid-stream. Instead:

  - Make this a formal error with an unambiugous name/description instead of something you sort of infer by seeing "<unknown>".
  - Make this error prevent generation of adjustment warnings, so we don't try to `ALTER TABLE t CHANGE COLUMN c <unknown>`, which is nonsense.
  - When schemata errors exist, surface them prominiently in `storage adjust`.

Overall:

  - Once `storage upgrade` runs `storage adjust` automatically (soon), this will make it relatively difficult to miss these errors.
  - Letting these errors slip through no longer escalates into a more severe issue.

Test Plan:
Commented out the recent `mailKey` spec and ran `storage adjust`:

```
$ ./bin/storage adjust --force
Verifying database schemata...
Found no adjustments for schemata.

Target                                            Error
phabricator2_phriction.phriction_document.mailKey Column Has No Specification

 SCHEMATA ERRORS

The schemata have serious errors (detailed above) which the adjustment
workflow can not fix.

If you are not developing Phabricator itself, report this issue to the
upstream.

If you are developing Phabricator, these errors usually indicate that your
schema specifications do not agree with the schemata your code actually
builds.
```

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10771
2014-11-04 04:42:05 -08:00
..
__tests__ Minor formatting changes 2014-10-08 08:39:49 +11:00
LiskDAO.php Do a better job of handling spec errors during schema adjustment 2014-11-04 04:42:05 -08:00
LiskDAOSet.php Purge loadRelativeEdges 2013-09-13 11:40:52 -07:00
LiskEphemeralObjectException.php Delete license headers from files 2012-11-05 11:16:51 -08:00
LiskMigrationIterator.php Delete license headers from files 2012-11-05 11:16:51 -08:00
LiskRawMigrationIterator.php Add LiskRawMigrationIterator 2013-06-21 12:55:07 -07:00
PhabricatorDataNotAttachedException.php Show image dimensions and some other metadata in Differential 2014-08-13 14:41:06 -07:00
PhabricatorLiskDAO.php Make Currency a more formal type 2014-10-06 10:26:48 -07:00
PhabricatorLiskSerializer.php Make Currency a more formal type 2014-10-06 10:26:48 -07:00