app-MAIL-temp/migrations/versions/2020_022819_5f191273d067_.py
2020-02-28 19:09:01 +07:00

41 lines
1.3 KiB
Python

"""empty message
Revision ID: 5f191273d067
Revises: 75093e7ded27
Create Date: 2020-02-28 19:08:15.570326
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5f191273d067'
down_revision = '75093e7ded27'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('account_activation',
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('code', sa.String(length=10), nullable=False),
sa.Column('tries', sa.Integer(), nullable=False),
sa.CheckConstraint('tries >= 0', name='account_activation_tries_positive'),
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('account_activation')
# ### end Alembic commands ###