aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_sql_migrations.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2012-01-15 15:43:59 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2012-01-29 16:33:46 -0600
commit473e06053c45de534d1e9e5d94f48cf0188856af (patch)
tree4a84ff8b9313204b05980e5bfb0ad1bb1d38b9e6 /mediagoblin/tests/test_sql_migrations.py
parent89694d6d69c855f1dbaaa725867ab070cc7b2490 (diff)
downloadmediagoblin-473e06053c45de534d1e9e5d94f48cf0188856af.tar.lz
mediagoblin-473e06053c45de534d1e9e5d94f48cf0188856af.tar.xz
mediagoblin-473e06053c45de534d1e9e5d94f48cf0188856af.zip
binding migration metadata to engine, and level_exits_new_table should now work
Diffstat (limited to 'mediagoblin/tests/test_sql_migrations.py')
-rw-r--r--mediagoblin/tests/test_sql_migrations.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/mediagoblin/tests/test_sql_migrations.py b/mediagoblin/tests/test_sql_migrations.py
index 0f1f02bd..ba9e967a 100644
--- a/mediagoblin/tests/test_sql_migrations.py
+++ b/mediagoblin/tests/test_sql_migrations.py
@@ -102,16 +102,16 @@ SET2_MODELS = [Creature2, CreaturePower2, Level2, LevelExit2]
@RegisterMigration(1, FULL_MIGRATIONS)
def creature_remove_is_demon(db_conn):
+ metadata = MetaData(bind=db_conn.engine)
creature_table = Table(
- 'creature', MetaData(),
+ 'creature', metadata,
autoload=True, autoload_with=db_conn.engine)
- db_conn.execute(
- creature_table.drop_column('is_demon'))
+ creature_table.drop_column('is_demon')
@RegisterMigration(2, FULL_MIGRATIONS)
def creature_powers_new_table(db_conn):
- metadata = MetaData()
+ metadata = MetaData(bind=db_conn.engine)
creature_powers = Table(
'creature_power', metadata,
Column('id', Integer, primary_key=True),
@@ -127,7 +127,7 @@ def creature_powers_new_table(db_conn):
def level_exits_new_table(db_conn):
# First, create the table
# -----------------------
- metadata = MetaData()
+ metadata = MetaData(bind=db_conn.engine)
level_exits = Table(
'level_exit', metadata,
Column('id', Integer, primary_key=True),
@@ -165,7 +165,7 @@ def level_exits_new_table(db_conn):
# Finally, drop the old level exits pickle table
# ----------------------------------------------
-
+ levels.drop_column('exits')
# A hack! At this point we freeze-fame and get just a partial list of