mirror of
https://github.com/simple-login/app.git
synced 2024-11-02 20:01:01 +01:00
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
|
"""empty message
|
||
|
|
||
|
Revision ID: c31cdf879ee3
|
||
|
Revises: 5cad8fa84386
|
||
|
Create Date: 2020-05-17 10:34:23.492008
|
||
|
|
||
|
"""
|
||
|
import sqlalchemy_utils
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = 'c31cdf879ee3'
|
||
|
down_revision = '5cad8fa84386'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_table('recovery_code',
|
||
|
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=16), nullable=False),
|
||
|
sa.Column('used', sa.Boolean(), nullable=False),
|
||
|
sa.Column('used_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
|
||
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
|
||
|
sa.PrimaryKeyConstraint('id'),
|
||
|
sa.UniqueConstraint('user_id', 'code', name='uq_recovery_code')
|
||
|
)
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.drop_table('recovery_code')
|
||
|
# ### end Alembic commands ###
|