deb-sahara/sahara/db/migration/alembic_migrations
Andrey Pavlov 53eaa64263 Formatting and mounting methods changed for ironic
Currently only cinder volumes can be formatted and mounted.
This patch provides an ability of formatting and mounting
any attached storage devices. Also storage_paths method was
moved from node group objects to instance and corresponding
fixes in plugins was made.

Closes-bug: #1478899
Closes-bug: #1478904

Change-Id: If92d6fdea25e374d6d5c404be5ac3677cb60c057
2015-09-18 10:44:45 +03:00
..
versions Formatting and mounting methods changed for ironic 2015-09-18 10:44:45 +03:00
env.py Using oslo_* instead of oslo.* 2015-02-04 13:19:28 +03:00
README.md Drop support database downgrades 2015-03-24 15:15:03 +03:00
script.py.mako Drop support database downgrades 2015-03-24 15:15:03 +03:00

The migrations in alembic_migrations/versions contain the changes needed to migrate between Sahara database revisions. A migration occurs by executing a script that details the changes needed to upgrade the database. The migration scripts are ordered so that multiple scripts can run sequentially. The scripts are executed by Sahara's migration wrapper which uses the Alembic library to manage the migration. Sahara supports migration from Icehouse or later.

You can upgrade to the latest database version via:

$ sahara-db-manage --config-file /path/to/sahara.conf upgrade head

To check the current database version:

$ sahara-db-manage --config-file /path/to/sahara.conf current

To create a script to run the migration offline:

$ sahara-db-manage --config-file /path/to/sahara.conf upgrade head --sql

To run the offline migration between specific migration versions:

$ sahara-db-manage --config-file /path/to/sahara.conf upgrade <start version>:<end version> --sql

Upgrade the database incrementally:

$ sahara-db-manage --config-file /path/to/sahara.conf upgrade --delta <# of revs>

Create new revision:

$ sahara-db-manage --config-file /path/to/sahara.conf revision -m "description of revision" --autogenerate

Create a blank file:

$ sahara-db-manage --config-file /path/to/sahara.conf revision -m "description of revision"

This command does not perform any migrations, it only sets the revision. Revision may be any existing revision. Use this command carefully.

$ sahara-db-manage --config-file /path/to/sahara.conf stamp <revision>

To verify that the timeline does branch, you can run this command:

$ sahara-db-manage --config-file /path/to/sahara.conf check_migration

If the migration path does branch, you can find the branch point via:

$ sahara-db-manage --config-file /path/to/sahara.conf history