migration script

This commit is contained in:
Son NK 2020-09-12 14:34:38 +02:00
parent c6eba9f125
commit fead5efc8b
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
"""empty message
Revision ID: b0e9a389939a
Revises: 84471852b610
Create Date: 2020-09-12 11:18:40.262432
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b0e9a389939a'
down_revision = '84471852b610'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('newsletter_alias_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'users', 'alias', ['newsletter_alias_id'], ['id'], ondelete='SET NULL')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'users', type_='foreignkey')
op.drop_column('users', 'newsletter_alias_id')
# ### end Alembic commands ###