mirror of
https://github.com/simple-login/app.git
synced 2025-02-23 23:34:05 +08:00
migration script
This commit is contained in:
parent
b01c91423f
commit
01a40ff801
1 changed files with 38 additions and 0 deletions
38
migrations/versions/2020_052319_00532ac6d4bc_.py
Normal file
38
migrations/versions/2020_052319_00532ac6d4bc_.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: 00532ac6d4bc
|
||||
Revises: 0e08145f0499
|
||||
Create Date: 2020-05-23 19:54:24.984674
|
||||
|
||||
"""
|
||||
import sqlalchemy_utils
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '00532ac6d4bc'
|
||||
down_revision = '0e08145f0499'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('notification',
|
||||
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('message', sa.Text(), nullable=False),
|
||||
sa.Column('read', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('notification')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue