api_key_id column will have to be dropped in a separate PR

This is to avoid situation where we deploy migration already
but don't deploy code yet and they are not compatible for a while
which leads to errors.
This commit is contained in:
Pea Tyczynska
2022-02-08 15:57:28 +00:00
parent 0737eceddb
commit f2bef7392e

View File

@@ -41,13 +41,11 @@ def upgrade():
)
op.get_bind()
op.execute("UPDATE broadcast_message SET created_by_api_key_id=api_key_id") # move data over
op.drop_column('broadcast_message', 'api_key_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('broadcast_message', sa.Column('api_key_id', postgresql.UUID(), autoincrement=False, nullable=True))
op.drop_constraint(
"ck_broadcast_message_created_by_not_null",
"broadcast_message"