add sql migration
This commit is contained in:
parent
b2f82ba4a8
commit
1f7779ed7b
|
@ -0,0 +1,31 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: a3c9a43e41f4
|
||||
Revises: a5b4dc311a89
|
||||
Create Date: 2020-06-25 13:02:21.128994
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a3c9a43e41f4'
|
||||
down_revision = 'a5b4dc311a89'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('users', sa.Column('default_random_alias_domain_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(None, 'users', 'custom_domain', ['default_random_alias_domain_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'users', type_='foreignkey')
|
||||
op.drop_column('users', 'default_random_alias_domain_id')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in New Issue