"""empty message

Revision ID: a8817b89299d
Revises: 198d82867b14
Create Date: 2021-09-25 10:49:46.235048

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a8817b89299d'
down_revision = '198d82867b14'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('creator',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('email', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_creator_email'), 'creator', ['email'], unique=True)
    op.create_index(op.f('ix_creator_name'), 'creator', ['name'], unique=True)
    op.create_table('advertising',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('title', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('create_at', sa.DateTime(), nullable=True),
    sa.Column('creator_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['creator_id'], ['creator.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_advertising_description'), 'advertising', ['description'], unique=True)
    op.create_index(op.f('ix_advertising_title'), 'advertising', ['title'], unique=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_advertising_title'), table_name='advertising')
    op.drop_index(op.f('ix_advertising_description'), table_name='advertising')
    op.drop_table('advertising')
    op.drop_index(op.f('ix_creator_name'), table_name='creator')
    op.drop_index(op.f('ix_creator_email'), table_name='creator')
    op.drop_table('creator')
    # ### end Alembic commands ###
