Skip to content

Commit

Permalink
Add down migration
Browse files Browse the repository at this point in the history
  • Loading branch information
rmol authored and sssoleileraaa committed Jul 2, 2019
1 parent fbc7aef commit 642a8b2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions alembic/versions/bafdcae12f97_.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"files",
sa.Column("original_filename", sa.String(length=255), nullable=False, server_default=""),
Expand All @@ -26,10 +25,7 @@ def upgrade():
conn = op.get_bind()
conn.execute("""UPDATE files SET original_filename = replace(filename, '.gz.gpg', '');""")

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
with op.batch_alter_table('files', schema=None) as batch_op:
batch_op.drop_column('original_filename')

0 comments on commit 642a8b2

Please sign in to comment.