Skip to content

Commit

Permalink
Execute attach_time query earlier in migration 98
Browse files Browse the repository at this point in the history
MySQL was blowing up when sqlalchemy tried to execute the subqueries
in up/downgrade for migration 98. SQLite wasn't blowing up on this so
the tests were passing in Jenkins.

There are no test changes as it depends on the functional environment
in which you run the tests, not the tests themselves.

Fixes bug 1047665

Change-Id: I6eb3c8dd03495cdda2574efc9b5fc2b495fbcb37
  • Loading branch information
bcwaldon committed Sep 7, 2012
1 parent 2caf52e commit 43ae413
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def upgrade(migrate_engine):
volumes_list = list(volumes.select().execute())
for v in volumes_list:
attach_time = select([volumes.c.attach_time],
volumes.c.id == v['id'])
volumes.c.id == v['id']).execute().fetchone()[0]
volumes.update().\
where(volumes.c.id == v['id']).\
values(attachtime_datetime=attach_time).execute()
Expand All @@ -59,7 +59,7 @@ def downgrade(migrate_engine):
volumes_list = list(volumes.select().execute())
for v in volumes_list:
attach_time = select([volumes.c.attach_time],
volumes.c.id == v['id'])
volumes.c.id == v['id']).execute().fetchone()[0]
volumes.update().\
where(volumes.c.id == v['id']).\
values(attachtime_string=attach_time).execute()
Expand Down

0 comments on commit 43ae413

Please sign in to comment.