"""Initial migration

Revision ID: 757b49078248
Revises: 
Create Date: 2020-12-14 12:15:07.114711

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('participants',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('races_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['races_id'], ['races.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
    )
    op.drop_table('race')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('race',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('race_name', sa.VARCHAR(length=100), nullable=False),
    sa.Column('race_type', sa.VARCHAR(length=30), nullable=False),
    sa.Column('race_date', sa.VARCHAR(length=30), nullable=True),
    sa.Column('race_city', sa.VARCHAR(length=25), nullable=False),
    sa.Column('race_state', sa.VARCHAR(length=25), nullable=False),
    sa.Column('race_date_registered', sa.DATETIME(), nullable=False),
    sa.Column('race_url', sa.VARCHAR(length=100), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('race_city'),
    sa.UniqueConstraint('race_name'),
    sa.UniqueConstraint('race_state'),
    sa.UniqueConstraint('race_url')
    )
    op.drop_table('participants')
    # ### end Alembic commands ###
