"""add domain token table

Revision ID: caea6de4c86b
Revises:
Create Date: 2020-07-09 14:28:52.831801+00:00

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'caea6de4c86b'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('domain_tokens',
    sa.Column('id', sa.BigInteger(), nullable=False),
    sa.Column('admin_id', sa.BigInteger(), nullable=True),
    sa.Column('pdd_version', sa.Enum('new', 'old', name='pddversion'), nullable=True),
    sa.Column('domain', sa.String(), nullable=True),
    sa.Column('token', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('domain_tokens')
    op.execute('DROP TYPE if exists pddversion')
    # ### end Alembic commands ###
