Remove the is_demon field from the creature model. We don't need
it!
"""
- metadata = MetaData(bind=db_conn.engine)
+ metadata = MetaData(bind=db_conn.bind)
creature_table = Table(
'creature', metadata,
- autoload=True, autoload_with=db_conn.engine)
+ autoload=True, autoload_with=db_conn.bind)
creature_table.drop_column('is_demon')
yet though as there wasn't anything that previously held this
information
"""
- metadata = MetaData(bind=db_conn.engine)
+ metadata = MetaData(bind=db_conn.bind)
creature_powers = Table(
'creature_power', metadata,
Column('id', Integer, primary_key=True),
Column('name', Unicode),
Column('description', Unicode),
Column('hitpower', Integer, nullable=False))
- metadata.create_all(db_conn.engine)
+ metadata.create_all(db_conn.bind)
@RegisterMigration(3, FULL_MIGRATIONS)
"""
# First, create the table
# -----------------------
- metadata = MetaData(bind=db_conn.engine)
+ metadata = MetaData(bind=db_conn.bind)
level_exits = Table(
'level_exit', metadata,
Column('id', Integer, primary_key=True),
Integer, ForeignKey('level.id'), nullable=False),
Column('to_level',
Integer, ForeignKey('level.id'), nullable=False))
- metadata.create_all(db_conn.engine)
+ metadata.create_all(db_conn.bind)
# And now, convert all the old exit pickles to new level exits
# ------------------------------------------------------------
specifically. Humans would be 4 here, for instance. So we
renamed the column.
"""
- metadata = MetaData(bind=db_conn.engine)
+ metadata = MetaData(bind=db_conn.bind)
creature_table = Table(
'creature', metadata,
- autoload=True, autoload_with=db_conn.engine)
+ autoload=True, autoload_with=db_conn.bind)
creature_table.c.num_legs.alter(name=u"num_limbs")
"""
Index the from and to levels of the level exit table.
"""
- metadata = MetaData(bind=db_conn.engine)
+ metadata = MetaData(bind=db_conn.bind)
level_exit = Table(
'level_exit', metadata,
- autoload=True, autoload_with=db_conn.engine)
- Index('ix_from_level', level_exit.c.from_level).create(db_conn.engine)
- Index('ix_to_exit', level_exit.c.to_exit).create(db_conn.engine)
+ autoload=True, autoload_with=db_conn.bind)
+ Index('ix_from_level', level_exit.c.from_level).create(db_conn.bind)
+ Index('ix_to_exit', level_exit.c.to_exit).create(db_conn.bind)
@RegisterMigration(6, FULL_MIGRATIONS)
"""
Index our foreign key relationship to the creatures
"""
- metadata = MetaData(bind=db_conn.engine)
+ metadata = MetaData(bind=db_conn.bind)
creature_power = Table(
'creature_power', metadata,
- autoload=True, autoload_with=db_conn.engine)
- Index('ix_creature', creature_power.c.creature).create(db_conn.engine)
+ autoload=True, autoload_with=db_conn.bind)
+ Index('ix_creature', creature_power.c.creature).create(db_conn.bind)
@RegisterMigration(7, FULL_MIGRATIONS)
Turns out we want super precise values of how much hitpower there
really is.
"""
- metadata = MetaData(bind=db_conn.engine)
+ metadata = MetaData(bind=db_conn.bind)
creature_power = Table(
'creature_power', metadata,
- autoload=True, autoload_with=db_conn.engine)
+ autoload=True, autoload_with=db_conn.bind)
creature_power.c.hitpower.alter(type=Float)
##### Set2
# creature_table = Table(
# 'creature', metadata,
- # autoload=True, autoload_with=db_conn.engine)
+ # autoload=True, autoload_with=db_conn.bind)
# assert set(creature_table.c.keys()) == set(
# ['id', 'name', 'num_legs'])
# assert_col_type(creature_table.c.id, Integer)
# # Check the CreaturePower table
# creature_power_table = Table(
# 'creature_power', metadata,
- # autoload=True, autoload_with=db_conn.engine)
+ # autoload=True, autoload_with=db_conn.bind)
# assert set(creature_power_table.c.keys()) == set(
# ['id', 'creature', 'name', 'description', 'hitpower'])
# assert_col_type(creature_power_table.c.id, Integer)
# # Check the structure of the level table
# level_table = Table(
# 'level', metadata,
- # autoload=True, autoload_with=db_conn.engine)
+ # autoload=True, autoload_with=db_conn.bind)
# assert set(level_table.c.keys()) == set(
# ['id', 'name', 'description'])
# assert_col_type(level_table.c.id, VARCHAR)
# # Check the structure of the level_exits table
# level_exit_table = Table(
# 'level_exit', metadata,
- # autoload=True, autoload_with=db_conn.engine)
+ # autoload=True, autoload_with=db_conn.bind)
# assert set(level_exit_table.c.keys()) == set(
# ['id', 'name', 'from_level', 'to_level'])
# assert_col_type(level_exit_table.c.id, Integer)