Add Alembic Modules to Enable Upgrades

Registered by John Wood

Revision as of 2015-Aug-24:
The following are Neutron alembic files that could be good examples I think:
- This alembic file does a time-zero bootstrap of the database: https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/juno_initial.py
(Not that the icehouse bootstrap is not available, I believe because we only support one year of releases)
- This alembic is the kilo milestone alembic file:
https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/kilo_release.py

Barbican uses Alembic to enable controlled modification of the database schema. However, Barbican is missing some Alembic version modules as compared to other OpenStack projects that use Alembic, such as Neutron and Sahara. In particular, Barbican should have a time-zero base script that creates all tables within the system (eg. https://github.com/openstack/sahara/blob/master/sahara/db/migration/alembic_migrations/versions/001_icehouse.py), and then Barbican should insert version modules that represent the schema at a final release (eg. https://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/icehouse_release.py). It would probably be sufficient to use Juno as the initial base line version as Barbican is not yet out of incubation. There should be no reason to compress or remove version files as long as the release version modules are inserted as per the example above. Once this effort is completed, running 'bin/barbican-db-manage.py --dburl http://www.anyhostnamehere.com history' should reveal the sequence of the Alembic version modules, with the base pointing to the juno_release.py version, with all other version files sequentially listed/dependent after that.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
John Wood
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

So I attempted to generate a forklift sort of version file from a blank database with the Juno final code base, hoping all my tables and attributes would magically appear in a single version file. Alembic complained so I gave up. It could be however that you need to put an alembic version table with a record on there first.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1423962,n,z

Addressed by: https://review.openstack.org/217004
    Make alembic used in barbican similar to other openstack projects

Gerrit topic: https://review.openstack.org/#q,topic:bp/add-missing-alembic-modules,n,z

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.