aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_sql_migrations.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2012-01-16 16:40:51 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2012-01-29 16:33:46 -0600
commit356654deb878d667806c347e47500a2dd0dadb09 (patch)
treec50f813c991529f73be930da2a9864fb57d85503 /mediagoblin/tests/test_sql_migrations.py
parentd74a9483ded26c575686b751e47c1e2a6f395fef (diff)
downloadmediagoblin-356654deb878d667806c347e47500a2dd0dadb09.tar.lz
mediagoblin-356654deb878d667806c347e47500a2dd0dadb09.tar.xz
mediagoblin-356654deb878d667806c347e47500a2dd0dadb09.zip
Docstrings for stage 2 migrations
Diffstat (limited to 'mediagoblin/tests/test_sql_migrations.py')
-rw-r--r--mediagoblin/tests/test_sql_migrations.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_sql_migrations.py b/mediagoblin/tests/test_sql_migrations.py
index 4d58cfbf..ccaf60ba 100644
--- a/mediagoblin/tests/test_sql_migrations.py
+++ b/mediagoblin/tests/test_sql_migrations.py
@@ -104,6 +104,10 @@ SET2_MODELS = [Creature2, CreaturePower2, Level2, LevelExit2]
@RegisterMigration(1, FULL_MIGRATIONS)
def creature_remove_is_demon(db_conn):
+ """
+ Remove the is_demon field from the creature model. We don't need
+ it!
+ """
metadata = MetaData(bind=db_conn.engine)
creature_table = Table(
'creature', metadata,
@@ -113,6 +117,11 @@ def creature_remove_is_demon(db_conn):
@RegisterMigration(2, FULL_MIGRATIONS)
def creature_powers_new_table(db_conn):
+ """
+ Add a new table for creature powers. Nothing needs to go in it
+ yet though as there wasn't anything that previously held this
+ information
+ """
metadata = MetaData(bind=db_conn.engine)
creature_powers = Table(
'creature_power', metadata,
@@ -127,6 +136,10 @@ def creature_powers_new_table(db_conn):
@RegisterMigration(3, FULL_MIGRATIONS)
def level_exits_new_table(db_conn):
+ """
+ Make a new table for level exits and move the previously pickled
+ stuff over to here (then drop the old unneeded table)
+ """
# First, create the table
# -----------------------
metadata = MetaData(bind=db_conn.engine)
@@ -258,6 +271,9 @@ def creature_power_hitpower_to_float(db_conn):
def _insert_migration1_objects(session):
+ """
+ Test objects to insert for the first set of things
+ """
# Insert creatures
session.add_all(
[Creature1(name='centipede',
@@ -293,6 +309,9 @@ def _insert_migration1_objects(session):
def _insert_migration2_objects(session):
+ """
+ Test objects to insert for the second set of things
+ """
# Insert creatures
session.add_all(
[Creature2(