Update alembic migration documentation

Alembic migration documentation for developers is updated to explain the need
to update neutron/db/migration/models/head.py when adding models to the
database

Change-Id: I2894058269cbabfd0cbfa83c7f076701e2087a11
Partial-Bug: #1537510
This commit is contained in:
Miguel Lavalle 2016-01-26 11:58:06 -06:00
parent 2c52dc40f0
commit 0a96b7a57e
1 changed files with 15 additions and 0 deletions

View File

@ -478,3 +478,18 @@ Tagging milestones allows neutron-db-manage to upgrade the schema to a
milestone release, e.g.::
neutron-db-manage upgrade liberty
Generation of comparable metadata with current database schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Directory ``neutron/db/migration/models`` contains module ``head.py``, which
provides all database models at current HEAD. Its purpose is to create
comparable metadata with the current database schema. The database schema is
generated by alembic migration scripts. The models must match, and this is
verified by a model-migration sync test in Neutron's functional test suite.
That test requires all modules containing DB models to be imported by head.py
in order to make a complete comparison.
When adding new database models, developers must update this module, otherwise
the change will fail to merge.