Homec4science

Simplify adding new database patches

Authored by epriestley <git@epriestley.com> on Jan 6 2014, 21:17.

Description

Simplify adding new database patches

Summary:
Currently, to add new migration patches you need to:

  • Add a file to resources/sql/patches/; then
  • add an entry to src/infrastructure/storage/blahblah/BlahBlahBlah.php.

The second step isn't actually necessary, and we've been using this system for a long time without any issues arising.

Instead of requiring manual adjustments to the patch list, infer the patch specifications from the files on disk so you don't need to do step 2.

Also, simplify the existing data, which can mostly be derived from patch names. There are a few exceptions/errors, noted inline, which are preserved for compatibility.

Test Plan:

  • For the new genration of name and type, I added code to check that the old and new values were the same before converting. This caught the two inline exceptions ("emailtableport", "drydockresouces").
  • Added new patches to autopatches/ and ran bin/storage status to verify they got picked up correctly.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7894

Details

Committed
epriestley <git@epriestley.com>Jan 6 2014, 21:17
Pushed
aubortJan 31 2017, 17:16
Parents
rPH543354981e52: Adjust transformed URI in CSS
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHd32c09de4112: Simplify adding new database patches (authored by epriestley <git@epriestley.com>).Jan 6 2014, 21:17