]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
[neutron-db-manage] support separate migration branches
authorIhar Hrachyshka <ihrachys@redhat.com>
Mon, 22 Jun 2015 14:23:36 +0000 (16:23 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Tue, 14 Jul 2015 10:10:36 +0000 (12:10 +0200)
commitc7acfbabdc13ed2a73bdbc6275af8063b8c1eb2f
tree9f46db4efba69f545bfd83b83e420d848619302b
parent95302aac849d466e2328c077c3634dd1c83ed589
[neutron-db-manage] support separate migration branches

New migration rule scheme is introduced. Now, changes are classified
into the following branches:

- expand (additive changes only)
- contract (contraction changes, including data migration)

Make 'neutron-db-manage revision' generate two separate migration
scripts, one per branch.

Now that we support multiple heads, renamed HEAD file in HEADS. We still
don't allow more branching, so keep validation for the number of
branches.

For backwards compatibility, calling to 'upgrade head' applies both
branches in proper order.

Note that advanced services will be moved to the new migration scheme in
separate patches for respective repos.

This patch does not introduce autogenerate support for multiple branches
for 'revision' command (that depends on a new alembic version yet
unreleased; but alembic/master already has everything to support us).

The patch does not implement 'expand' or 'contract' commands that are
anticipated by the spec proposal. Those will come in consequent patches.

Upgrade impact is backwards compatible: those who are interested in
reducing downtime while applying some migration rules can opt in it by
modifying their upgrade practices, while everything should still work
the old way for those who don't care.

blueprint online-schema-migrations

DocImpact
UpgradeImpact

Change-Id: I3823900bc5aaf7757c37edb804027cf4d9c757ab
doc/source/devref/db_layer.rst
neutron/db/migration/alembic_migrations/versions/HEAD [deleted file]
neutron/db/migration/alembic_migrations/versions/HEADS [new file with mode: 0644]
neutron/db/migration/alembic_migrations/versions/liberty/contract/30018084ec99_initial.py [new file with mode: 0644]
neutron/db/migration/alembic_migrations/versions/liberty/expand/354db87e3225_nsxv_vdr_metadata.py [moved from neutron/db/migration/alembic_migrations/versions/354db87e3225_nsxv_vdr_metadata.py with 94% similarity]
neutron/db/migration/alembic_migrations/versions/liberty/expand/52c5312f6baf_address_scopes.py [moved from neutron/db/migration/alembic_migrations/versions/52c5312f6baf_address_scopes.py with 100% similarity]
neutron/db/migration/alembic_migrations/versions/liberty/expand/599c6a226151_neutrodb_ipam.py [moved from neutron/db/migration/alembic_migrations/versions/599c6a226151_neutrodb_ipam.py with 100% similarity]
neutron/db/migration/cli.py
neutron/tests/functional/db/test_migrations.py
neutron/tests/unit/db/test_migration.py