Skip to content

Commit

Permalink
Get rid of DeprecationWarning during db migration
Browse files Browse the repository at this point in the history
Use proper syntax to set column type, which avoids printing
silly warnings and future deprecation issues.
Fixes bug 854163.

Change-Id: Iab1c3e7a52d739a445cf52eb9a67f61a69075026
  • Loading branch information
ttx committed Feb 3, 2012
1 parent 300d403 commit c6c458e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions glance/registry/db/migrate_repo/versions/012_id_to_uuid.py
Expand Up @@ -71,9 +71,7 @@ def _upgrade_sqlite(t_images, t_image_members, t_image_properties):
"""
Upgrade 011 -> 012 with special SQLite-compatible logic.
"""
t_images.c.id.alter(sqlalchemy.Column("id",
sqlalchemy.String(36),
primary_key=True))
t_images.c.id.alter(sqlalchemy.String(36), primary_key=True)

sql_commands = [
"""CREATE TABLE image_members_backup (
Expand Down Expand Up @@ -121,9 +119,7 @@ def _downgrade_sqlite(t_images, t_image_members, t_image_properties):
"""
Downgrade 012 -> 011 with special SQLite-compatible logic.
"""
t_images.c.id.alter(sqlalchemy.Column("id",
sqlalchemy.Integer(),
primary_key=True))
t_images.c.id.alter(sqlalchemy.Integer(), primary_key=True)

sql_commands = [
"""CREATE TABLE image_members_backup (
Expand Down

0 comments on commit c6c458e

Please sign in to comment.