<gh_stars>100-1000
"""Email Token table

Revision ID: 58<PASSWORD>3f5
Revises: 09ac195ca9c7
Create Date: 2019-04-22 14:53:45.025971

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "580<PASSWORD>e3f5"
down_revision = "09ac195ca9c7"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "email_token",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("token", sa.String(length=32), nullable=False),
        sa.Column("date_generated", sa.DateTime(), nullable=False),
        sa.Column("user_id", sa.Integer(), nullable=False),
        sa.Column("token_type", sa.String(length=8), nullable=False),
        sa.Column("token_expiration", sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(["user_id"], ["user.id"]),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("token"),
    )
    op.create_index(
        op.f("ix_email_token_token_type"), "email_token", ["token_type"], unique=False
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_email_token_token_type"), table_name="email_token")
    op.drop_table("email_token")
    # ### end Alembic commands ###

"""Email Token table

Revision ID: 58<PASSWORD>3f5
Revises: 09ac195ca9c7
Create Date: 2019-04-22 14:53:45.025971

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "580<PASSWORD>e3f5"
down_revision = "09ac195ca9c7"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "email_token",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("token", sa.String(length=32), nullable=False),
        sa.Column("date_generated", sa.DateTime(), nullable=False),
        sa.Column("user_id", sa.Integer(), nullable=False),
        sa.Column("token_type", sa.String(length=8), nullable=False),
        sa.Column("token_expiration", sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(["user_id"], ["user.id"]),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("token"),
    )
    op.create_index(
        op.f("ix_email_token_token_type"), "email_token", ["token_type"], unique=False
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_email_token_token_type"), table_name="email_token")
    op.drop_table("email_token")
    # ### end Alembic commands ###
Email Token table  Revision ID: 58<PASSWORD>3f5 Revises: 09ac195ca9c7 Create Date: 2019-04-22 14:53:45.025971 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###