glance.db.sqlalchemy.migrate_repo package¶
Subpackages¶
- glance.db.sqlalchemy.migrate_repo.versions package
- Submodules
- glance.db.sqlalchemy.migrate_repo.versions.001_add_images_table module
- glance.db.sqlalchemy.migrate_repo.versions.002_add_image_properties_table module
- glance.db.sqlalchemy.migrate_repo.versions.003_add_disk_format module
- glance.db.sqlalchemy.migrate_repo.versions.004_add_checksum module
- glance.db.sqlalchemy.migrate_repo.versions.005_size_big_integer module
- glance.db.sqlalchemy.migrate_repo.versions.006_key_to_name module
- glance.db.sqlalchemy.migrate_repo.versions.007_add_owner module
- glance.db.sqlalchemy.migrate_repo.versions.008_add_image_members_table module
- glance.db.sqlalchemy.migrate_repo.versions.009_add_mindisk_and_minram module
- glance.db.sqlalchemy.migrate_repo.versions.010_default_update_at module
- glance.db.sqlalchemy.migrate_repo.versions.011_make_mindisk_and_minram_notnull module
- glance.db.sqlalchemy.migrate_repo.versions.012_id_to_uuid module
- glance.db.sqlalchemy.migrate_repo.versions.013_add_protected module
- glance.db.sqlalchemy.migrate_repo.versions.014_add_image_tags_table module
- glance.db.sqlalchemy.migrate_repo.versions.015_quote_swift_credentials module
- glance.db.sqlalchemy.migrate_repo.versions.016_add_status_image_member module
- glance.db.sqlalchemy.migrate_repo.versions.017_quote_encrypted_swift_credentials module
- glance.db.sqlalchemy.migrate_repo.versions.018_add_image_locations_table module
- glance.db.sqlalchemy.migrate_repo.versions.019_migrate_image_locations module
- glance.db.sqlalchemy.migrate_repo.versions.020_drop_images_table_location module
- glance.db.sqlalchemy.migrate_repo.versions.021_set_engine_mysql_innodb module
- glance.db.sqlalchemy.migrate_repo.versions.022_image_member_index module
- glance.db.sqlalchemy.migrate_repo.versions.023_placeholder module
- glance.db.sqlalchemy.migrate_repo.versions.024_placeholder module
- glance.db.sqlalchemy.migrate_repo.versions.025_placeholder module
- glance.db.sqlalchemy.migrate_repo.versions.026_add_location_storage_information module
- glance.db.sqlalchemy.migrate_repo.versions.027_checksum_index module
- glance.db.sqlalchemy.migrate_repo.versions.028_owner_index module
- glance.db.sqlalchemy.migrate_repo.versions.029_location_meta_data_pickle_to_string module
- glance.db.sqlalchemy.migrate_repo.versions.030_add_tasks_table module
- glance.db.sqlalchemy.migrate_repo.versions.031_remove_duplicated_locations module
- glance.db.sqlalchemy.migrate_repo.versions.032_add_task_info_table module
- glance.db.sqlalchemy.migrate_repo.versions.033_add_location_status module
- glance.db.sqlalchemy.migrate_repo.versions.034_add_virtual_size module
- glance.db.sqlalchemy.migrate_repo.versions.035_add_metadef_tables module
- glance.db.sqlalchemy.migrate_repo.versions.036_rename_metadef_schema_columns module
- glance.db.sqlalchemy.migrate_repo.versions.037_add_changes_to_satisfy_models module
- glance.db.sqlalchemy.migrate_repo.versions.038_add_metadef_tags_table module
- glance.db.sqlalchemy.migrate_repo.versions.039_add_changes_to_satisfy_models_metadef module
- glance.db.sqlalchemy.migrate_repo.versions.040_add_changes_to_satisfy_metadefs_tags module
- glance.db.sqlalchemy.migrate_repo.versions.041_add_artifact_tables module
- glance.db.sqlalchemy.migrate_repo.versions.042_add_changes_to_reinstall_unique_metadef_constraints module
- glance.db.sqlalchemy.migrate_repo.versions.043_add_image_created_updated_idx module
- glance.db.sqlalchemy.migrate_repo.versions.044_update_metadef_os_nova_server module
- glance.db.sqlalchemy.migrate_repo.versions.045_add_visibility module
- Module contents
Submodules¶
glance.db.sqlalchemy.migrate_repo.manage module¶
glance.db.sqlalchemy.migrate_repo.schema module¶
Various conveniences used for migration scripts
-
glance.db.sqlalchemy.migrate_repo.schema.
BigInteger
()¶
-
glance.db.sqlalchemy.migrate_repo.schema.
Boolean
()¶
-
glance.db.sqlalchemy.migrate_repo.schema.
DateTime
()¶
-
glance.db.sqlalchemy.migrate_repo.schema.
Integer
()¶
-
glance.db.sqlalchemy.migrate_repo.schema.
Numeric
()¶
-
glance.db.sqlalchemy.migrate_repo.schema.
PickleType
()¶
-
glance.db.sqlalchemy.migrate_repo.schema.
String
(length)¶
-
glance.db.sqlalchemy.migrate_repo.schema.
Text
()¶
-
glance.db.sqlalchemy.migrate_repo.schema.
from_migration_import
(module_name, fromlist)[source]¶ Import a migration file and return the module
Parameters: - module_name – name of migration module to import from (ex: 001_add_images_table)
- fromlist – list of items to import (ex: define_images_table)
Returns: module object
This bit of ugliness warrants an explanation:
As you’re writing migrations, you’ll frequently want to refer to tables defined in previous migrations.
In the interest of not repeating yourself, you need a way of importing that table into a ‘future’ migration.
However, tables are bound to metadata, so what you need to import is really a table factory, which you can late-bind to your current metadata object.
Moreover, migrations begin with a number (001...), which means they aren’t valid Python identifiers. This means we can’t perform a ‘normal’ import on them (the Python lexer will ‘splode). Instead, we need to use __import__ magic to bring the table-factory into our namespace.
Example Usage:
- (define_images_table,) = from_migration_import(
- ‘001_add_images_table’, [‘define_images_table’])
images = define_images_table(meta)
# Refer to images table