Commit eb968340 authored by echel0n's avatar echel0n
Browse files

Added check for scene_numbering table existence when upgrading main database to v16

parent 90b3a672
......@@ -16,9 +16,9 @@ down_revision = '15'
def upgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
tv_episodes = sa.Table('tv_episodes', meta, autoload=True)
scene_numbering = sa.Table('scene_numbering', meta, autoload=True)
if conn.engine.dialect.has_table(conn.engine, 'scene_numbering'):
scene_numbering = sa.Table('scene_numbering', meta, autoload=True)
with op.get_context().begin_transaction():
for row in conn.execute(scene_numbering.select()):
conn.execute('UPDATE tv_episodes SET scene_season = {} WHERE tv_episodes.showid = {}, tv_episodes.season = {}, tv_episodes.episode = {}'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment