mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 23:34:05 +08:00
Add necessary migration script
This commit is contained in:
parent
77baf60ca4
commit
ccb2d62906
1 changed files with 39 additions and 0 deletions
39
migrations/versions/2020_022316_e3cb44b953f2_.py
Normal file
39
migrations/versions/2020_022316_e3cb44b953f2_.py
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: e3cb44b953f2
|
||||||
|
Revises: f580030d9beb
|
||||||
|
Create Date: 2020-02-23 16:43:45.843338
|
||||||
|
|
||||||
|
"""
|
||||||
|
import sqlalchemy_utils
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'e3cb44b953f2'
|
||||||
|
down_revision = 'f580030d9beb'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_table('manual_subscription',
|
||||||
|
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('user_id', sa.Integer(), nullable=False),
|
||||||
|
sa.Column('end_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
|
||||||
|
sa.Column('comment', sa.Text(), nullable=True),
|
||||||
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
|
||||||
|
sa.PrimaryKeyConstraint('id'),
|
||||||
|
sa.UniqueConstraint('user_id')
|
||||||
|
)
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_table('manual_subscription')
|
||||||
|
# ### end Alembic commands ###
|
Loading…
Reference in a new issue