SQL backends for the various services.
Before using this module, call initialize(). This has to be done before CONF() because it sets up configuration options.
Bases: oslo_db.sqlalchemy.models.ModelBase
Bases: sqlalchemy.sql.type_api.TypeDecorator
alias of Text
Apply filtering and limit to a query.
Parameters: |
|
---|---|
Returns: | updated query |
Convert select sqlalchemy exceptions into HTTP 409 Conflict.
Ensure that the length of string field do not exceed the limit.
This decorator check the initialize arguments, to make sure the length of string field do not exceed the length limit, or raise a ‘StringLengthExceeded’ exception.
Use decorator instead of inheritance, because the metaclass will check the __tablename__, primary key columns, etc. at the class definition.
Contract the database.
This is run manually by the keystone-manage command once the keystone nodes have been upgraded to the latest release and will remove any old tables/columns that are no longer required.
Expand the database schema ahead of data migration.
This is run manually by the keystone-manage command before the first keystone node is migrated to the latest release.
Get the initial version of a migrate repository.
Parameters: | abs_path – Absolute path to migrate repository. |
---|---|
Returns: | initial version number or None, if DB is empty. |
Migrate data to match the new schema.
This is run manually by the keystone-manage command once the keystone schema has been expanded for the new release.
Perform and off-line sync of the database.
Migrate the database up to the latest version, doing the equivalent of the cycle of –expand, –migrate and –contract, for when an offline upgrade is being performed.
If a version is specified then only migrate the database up to that version. Downgrading is not supported. If version is specified, then only the main database migration is carried out - and the expand, migration and contract phases will NOT be run.
Rename tables with foreign key constraints.
Tables are renamed after first removing constraints. The constraints are replaced after the rename is complete.
This works on databases that don’t support renaming tables that have constraints on them (DB2).
renames is a dict, mapping {‘to_table_name’: from_table, ...}