mirror of
https://github.com/simple-login/app.git
synced 2025-02-20 22:02:54 +08:00
migration script
This commit is contained in:
parent
2fbc2c171b
commit
be7ef9bbe9
1 changed files with 40 additions and 0 deletions
40
migrations/versions/2020_052312_0e08145f0499_.py
Normal file
40
migrations/versions/2020_052312_0e08145f0499_.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: 0e08145f0499
|
||||
Revises: ce15cf3467b4
|
||||
Create Date: 2020-05-23 12:06:25.707402
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0e08145f0499'
|
||||
down_revision = 'ce15cf3467b4'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('domain_deleted_alias',
|
||||
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
||||
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
|
||||
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
|
||||
sa.Column('email', sa.String(length=256), nullable=False),
|
||||
sa.Column('domain_id', sa.Integer(), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['domain_id'], ['custom_domain.id'], ondelete='cascade'),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('domain_id', 'email', name='uq_domain_trash')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('domain_deleted_alias')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue