ironic.db.sqlalchemy.migration module

ironic.db.sqlalchemy.migration.create_schema(config=None, engine=None)[source]

Create database schema from models description.

Can be used for initial installation instead of upgrade(‘head’).

ironic.db.sqlalchemy.migration.downgrade(revision, config=None)[source]

Used for downgrading database.

Parameters

version (string) – Desired database version

ironic.db.sqlalchemy.migration.revision(message=None, autogenerate=False, config=None)[source]

Creates template for migration.

Parameters
  • message (string) – Text that will be used for migration title

  • autogenerate (bool) – If True - generates diff based on current database state

ironic.db.sqlalchemy.migration.stamp(revision, config=None)[source]

Stamps database with provided revision.

Don’t run any migrations.

Parameters

revision (string) – Should match one from repository or head - to stamp database with most recent revision

ironic.db.sqlalchemy.migration.upgrade(revision, config=None)[source]

Used for upgrading database.

Parameters

version (string) – Desired database version

ironic.db.sqlalchemy.migration.version(config=None, engine=None)[source]

Current database version.

Returns

Database version

Return type

string