diff --git a/glance/db/migration.py b/glance/db/migration.py index 8f59c9ad..3709f068 100644 --- a/glance/db/migration.py +++ b/glance/db/migration.py @@ -62,5 +62,4 @@ def db_sync(version=None, init_version=0, engine=None): return get_backend().db_sync(engine=engine, abs_path=MIGRATE_REPO_PATH, version=version, - init_version=init_version, - sanity_check=False) + init_version=init_version) diff --git a/glance/db/sqlalchemy/migrate_repo/versions/001_add_images_table.py b/glance/db/sqlalchemy/migrate_repo/versions/001_add_images_table.py index 06e5303f..2b9092c7 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/001_add_images_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/001_add_images_table.py @@ -42,6 +42,7 @@ def define_images_table(meta): default=False, index=True), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) return images diff --git a/glance/db/sqlalchemy/migrate_repo/versions/002_add_image_properties_table.py b/glance/db/sqlalchemy/migrate_repo/versions/002_add_image_properties_table.py index 98d98938..64b64f49 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/002_add_image_properties_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/002_add_image_properties_table.py @@ -60,6 +60,7 @@ def define_image_properties_table(meta): UniqueConstraint('image_id', 'key', **constr_kwargs), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) if meta.bind.name != 'ibm_db_sa': diff --git a/glance/db/sqlalchemy/migrate_repo/versions/008_add_image_members_table.py b/glance/db/sqlalchemy/migrate_repo/versions/008_add_image_members_table.py index 023dd0c1..ff637850 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/008_add_image_members_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/008_add_image_members_table.py @@ -71,6 +71,7 @@ def get_image_members_table(meta): default=False, index=True), UniqueConstraint('image_id', 'member'), + mysql_charset='utf8', mysql_engine='InnoDB', extend_existing=True) diff --git a/glance/db/sqlalchemy/migrate_repo/versions/014_add_image_tags_table.py b/glance/db/sqlalchemy/migrate_repo/versions/014_add_image_tags_table.py index d0f7bd31..5f41fd5e 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/014_add_image_tags_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/014_add_image_tags_table.py @@ -46,7 +46,8 @@ def define_image_tags_table(meta): glance_schema.Boolean(), nullable=False, default=False), - mysql_engine='InnoDB') + mysql_engine='InnoDB', + mysql_charset='utf8') schema.Index('ix_image_tags_image_id', image_tags.c.image_id) diff --git a/glance/db/sqlalchemy/migrate_repo/versions/018_add_image_locations_table.py b/glance/db/sqlalchemy/migrate_repo/versions/018_add_image_locations_table.py index 4cbceab2..5809d95a 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/018_add_image_locations_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/018_add_image_locations_table.py @@ -50,6 +50,8 @@ def upgrade(migrate_engine): nullable=False, default=False, index=True), + mysql_engine='InnoDB', + mysql_charset='utf8', ) schema.create_tables([image_locations_table]) diff --git a/glance/db/sqlalchemy/migrate_repo/versions/030_add_tasks_table.py b/glance/db/sqlalchemy/migrate_repo/versions/030_add_tasks_table.py index 8f882937..f1c5ec98 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/030_add_tasks_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/030_add_tasks_table.py @@ -39,6 +39,7 @@ def define_tasks_table(meta): nullable=False, default=False), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) Index('ix_tasks_type', tasks.c.type) diff --git a/glance/db/sqlalchemy/migrate_repo/versions/032_add_task_info_table.py b/glance/db/sqlalchemy/migrate_repo/versions/032_add_task_info_table.py index 8215b91d..bc513493 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/032_add_task_info_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/032_add_task_info_table.py @@ -37,7 +37,8 @@ def define_task_info_table(meta): Column('input', Text()), Column('result', Text()), Column('message', Text()), - mysql_engine='InnoDB') + mysql_engine='InnoDB', + mysql_charset='utf8') return task_info diff --git a/glance/db/sqlalchemy/migrate_repo/versions/035_add_metadef_tables.py b/glance/db/sqlalchemy/migrate_repo/versions/035_add_metadef_tables.py index 43e5ff06..2674d1c5 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/035_add_metadef_tables.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/035_add_metadef_tables.py @@ -66,6 +66,7 @@ def define_metadef_namespaces_table(meta): Column('updated_at', DateTime()), UniqueConstraint('namespace', **_constr_kwargs), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) if meta.bind.name != 'ibm_db_sa': @@ -95,6 +96,7 @@ def define_metadef_objects_table(meta): UniqueConstraint('namespace_id', 'name', **_constr_kwargs), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) if meta.bind.name != 'ibm_db_sa': @@ -123,6 +125,7 @@ def define_metadef_properties_table(meta): Column('updated_at', DateTime()), UniqueConstraint('namespace_id', 'name', **_constr_kwargs), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) if meta.bind.name != 'ibm_db_sa': @@ -149,6 +152,7 @@ def define_metadef_resource_types_table(meta): Column('updated_at', DateTime()), UniqueConstraint('name', **_constr_kwargs), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) if meta.bind.name != 'ibm_db_sa': @@ -180,6 +184,7 @@ def define_metadef_namespace_resource_types_table(meta): UniqueConstraint('resource_type_id', 'namespace_id', **_constr_kwargs), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) if meta.bind.name != 'ibm_db_sa': diff --git a/glance/db/sqlalchemy/migrate_repo/versions/038_add_metadef_tags_table.py b/glance/db/sqlalchemy/migrate_repo/versions/038_add_metadef_tags_table.py index f0a2610c..9fb3f1f7 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/038_add_metadef_tags_table.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/038_add_metadef_tags_table.py @@ -33,6 +33,7 @@ def define_metadef_tags_table(meta): UniqueConstraint('namespace_id', 'name', **_constr_kwargs), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=False) if meta.bind.name != 'ibm_db_sa': diff --git a/glance/db/sqlalchemy/migrate_repo/versions/041_add_artifact_tables.py b/glance/db/sqlalchemy/migrate_repo/versions/041_add_artifact_tables.py index 7ce475ac..71ce32c7 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/041_add_artifact_tables.py +++ b/glance/db/sqlalchemy/migrate_repo/versions/041_add_artifact_tables.py @@ -44,6 +44,7 @@ def define_artifacts_table(meta): Column('deleted_at', DateTime()), Column('published_at', DateTime()), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) Index('ix_artifact_name_and_version', artifacts.c.name, @@ -69,6 +70,7 @@ def define_artifact_tags_table(meta): Column('updated_at', DateTime(), nullable=False), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) Index('ix_artifact_tags_artifact_id', artifact_tags.c.artifact_id) @@ -101,6 +103,7 @@ def define_artifact_dependencies_table(meta): Column('updated_at', DateTime(), nullable=False), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) Index('ix_artifact_dependencies_source_id', @@ -132,6 +135,7 @@ def define_artifact_blobs_table(meta): Column('updated_at', DateTime(), nullable=False), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) Index('ix_artifact_blobs_artifact_id', artifact_blobs.c.artifact_id) @@ -162,6 +166,7 @@ def define_artifact_properties_table(meta): nullable=False), Column('position', Integer()), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) Index('ix_artifact_properties_artifact_id', artifact_properties.c.artifact_id) @@ -187,6 +192,7 @@ def define_artifact_blob_locations_table(meta): Column('status', String(36), nullable=True), mysql_engine='InnoDB', + mysql_charset='utf8', extend_existing=True) Index('ix_artifact_blob_locations_blob_id', artifact_blob_locations.c.blob_id) diff --git a/glance/tests/unit/test_migrations.py b/glance/tests/unit/test_migrations.py index fe451c5e..be70cfe2 100644 --- a/glance/tests/unit/test_migrations.py +++ b/glance/tests/unit/test_migrations.py @@ -126,7 +126,8 @@ class MigrationsMixin(test_migrations.WalkVersionsMixin): sqlalchemy.Boolean(), nullable=False, default=False), - mysql_engine='InnoDB') + mysql_engine='InnoDB', + mysql_charset='utf8') images_001.create() def test_version_control_existing_db(self):