PCv5/migrations/versions/c7779a558510_add_promotion_...

31 lines
817 B
Python

"""add promotion information to topics
Revision ID: c7779a558510
Revises: 001d2eaf0413
Create Date: 2020-08-01 11:27:23.298821
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c7779a558510'
down_revision = '001d2eaf0413'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('topic', sa.Column('promotion_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'topic', 'post', ['promotion_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'topic', type_='foreignkey')
op.drop_column('topic', 'promotion_id')
# ### end Alembic commands ###