Update git submodules
* Update masakari from branch 'master' to ed872b3fe04a4ad2674d30ecb3bdc984633fdfb7 - db: Add initial alembic migration This was generated using the same approach first used in heat [1], but with a difference to account for the fact that, unlike heat, we have a migration added in recent times. We generate our initial schema automatically based on our models using alembic's auto-generate functionality: alembic --config masakari/db/sqlalchemy/alembic.ini \ revision -m 'Initial empty revision' alembic --config masakari/db/sqlalchemy/alembic.ini \ upgrade head alembic --config masakari/db/sqlalchemy/alembic.ini \ revision -m 'Auto-generated revision' --autogenerate The two files were then combined, formatting and imports adjusted. We then *remove* the parts of the migration related to the 'vm_moves' table and run the autogeneration step again: alembic --config masakari/db/sqlalchemy/alembic.ini \ revision -m 'Add vm moves table' --autogenerate As noted above, this is necessary since we're going to need to support alembic-based migrations for users jumping from e.g. Zed to Bobcat. Once done, the schema of these migrations and the sqlalchemy-migrate migrations are compared. This step was done by comparing the schemas of a database created by the sqlalchemy-migrate tool to the one created by alembic. First, we compared the initial alembic migration which corresponds to the state of the database after sqlalchemy-migrate migration 007: alembic --config masakari/db/sqlalchemy/alembic.ini \ upgrade 8f848eb45d03 python masakari/db/sqlalchemy/migrate_repo/manage.py version_control \ sqlite:///masakari-old.db 000 python masakari/db/sqlalchemy/migrate_repo/manage.py upgrade \ sqlite:///masakari-old.db 007 With the two databases created, we can compare them using the methodologies described in [2]. Once this is done, we do the same things for the final migration to generate its own alembic variation of the migration. alembic --config masakari/db/sqlalchemy/alembic.ini \ upgrade head python masakari/db/sqlalchemy/migrate_repo/manage.py upgrade \ sqlite:///masakari-old.db These last steps highlight some small differences between the schemas. These changes are kept to a separate change to make them more obvious. [1] https://review.opendev.org/c/openstack/heat/+/878350 [2] https://that.guru/blog/comparing-nova-db-migrations/ Change-Id: I6d0f27ba1d81e75010e8b56c70172ccf32c1abb3 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
6ebbdea78a
commit
491d872035
2
masakari
2
masakari
@ -1 +1 @@
|
||||
Subproject commit 13ae6c01c9d910aead73abb3ce2b24af6af7a6a2
|
||||
Subproject commit ed872b3fe04a4ad2674d30ecb3bdc984633fdfb7
|
Loading…
Reference in New Issue
Block a user