The oslo_db.sqlalchemy.migration_cli.ext_alembic Module

class oslo_db.sqlalchemy.migration_cli.ext_alembic.AlembicExtension(engine, migration_config)

Bases: oslo_db.sqlalchemy.migration_cli.ext_base.MigrationExtensionBase

Extension to provide alembic features.

Parameters:
  • engine (sqlalchemy.engine.Engine) – SQLAlchemy engine instance for a given database
  • migration_config (dict) – Stores specific configuration for migrations
downgrade(version)
enabled
has_revision(rev_id)
order = 2
revision(message='', autogenerate=False)

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
stamp(revision)

Stamps database with provided revision.

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

Previous topic

The oslo_db.sqlalchemy.migration Module

Next topic

The oslo_db.sqlalchemy.migration_cli.ext_base Module

Project Source

This Page