"""next update

Revision ID: 3859852f6dbb
Revises: 54efef3ec42e
Create Date: 2021-03-16 21:45:27.261695

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3859852f6dbb'
down_revision = '54efef3ec42e'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('Exercise',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('ExerciseID', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('series', sa.Integer(), nullable=False),
    sa.Column('total_shoot', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('ExerciseData',
    sa.Column('ExerciseDataID', sa.Integer(), nullable=False),
    sa.Column('EventsDataID', sa.Integer(), nullable=False),
    sa.Column('ex1', sa.Float(), nullable=True),
    sa.Column('ex2', sa.Float(), nullable=True),
    sa.Column('ex3', sa.Float(), nullable=True),
    sa.Column('ex4', sa.Float(), nullable=True),
    sa.Column('ex5', sa.Float(), nullable=True),
    sa.Column('ex6', sa.Float(), nullable=True),
    sa.Column('ex7', sa.Float(), nullable=True),
    sa.Column('ex8', sa.Float(), nullable=True),
    sa.Column('ex9', sa.Float(), nullable=True),
    sa.Column('ex10', sa.Float(), nullable=True),
    sa.Column('tens_count', sa.Integer(), nullable=True),
    sa.Column('result_player', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['EventsDataID'], ['EventsData.id'], ),
    sa.PrimaryKeyConstraint('ExerciseDataID')
    )
    op.add_column('EventsData', sa.Column('ExerciseID', sa.Integer(), nullable=False))
    op.create_foreign_key(None, 'EventsData', 'Exercise', ['ExerciseID'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'EventsData', type_='foreignkey')
    op.drop_column('EventsData', 'ExerciseID')
    op.drop_table('ExerciseData')
    op.drop_table('Exercise')
    # ### end Alembic commands ###
