Skip to content

Commit

Permalink
Autoload schema before creating FK's (bug 1098174)
Browse files Browse the repository at this point in the history
The 'service' schema must be loaded before sqlalchemy-migrate can create
ForeignKeys referencing it.

Change-Id: Icd87d40f4c01e4daec0fdb7a6ad93847958236ec
  • Loading branch information
dolph committed Jan 14, 2013
1 parent 2a851d8 commit 57f1e30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Expand Up @@ -25,6 +25,7 @@ def upgrade(migrate_engine):
legacy_table = sql.Table('endpoint', meta, autoload=True)
legacy_table.rename('endpoint_v2')

sql.Table('service', meta, autoload=True)
new_table = sql.Table(
'endpoint_v3',
meta,
Expand Down
Expand Up @@ -37,6 +37,7 @@ def downgrade(migrate_engine):
new_table = sql.Table('endpoint', meta, autoload=True)
new_table.rename('endpoint_v3')

sql.Table('service', meta, autoload=True)
legacy_table = sql.Table(
'endpoint_v2',
meta,
Expand Down

0 comments on commit 57f1e30

Please sign in to comment.