"""add table for tests results

Revision ID: 39f35c43a242
Revises: 01ab5b43e4bb
Create Date: 2021-04-12 18:35:36.629415

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '39f35c43a242'
down_revision = '01ab5b43e4bb'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('result',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('id_user', sa.Integer(), nullable=True),
    sa.Column('id_test', sa.Integer(), nullable=False),
    sa.Column('mark', sa.Integer(), nullable=False),
    sa.Column('score', sa.Integer(), nullable=False),
    sa.Column('quests', sa.Integer(), nullable=False),
    sa.Column('datetime_red', sa.DateTime(), nullable=True),
    sa.Column('datetime_upd', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['id_test'], ['test.id'], ),
    sa.ForeignKeyConstraint(['id_user'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_result_datetime_red'), 'result', ['datetime_red'], unique=False)
    # ### end Alembic commands ###


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

"""add table for tests results

Revision ID: 39f35c43a242
Revises: 01ab5b43e4bb
Create Date: 2021-04-12 18:35:36.629415

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '39f35c43a242'
down_revision = '01ab5b43e4bb'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('result',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('id_user', sa.Integer(), nullable=True),
    sa.Column('id_test', sa.Integer(), nullable=False),
    sa.Column('mark', sa.Integer(), nullable=False),
    sa.Column('score', sa.Integer(), nullable=False),
    sa.Column('quests', sa.Integer(), nullable=False),
    sa.Column('datetime_red', sa.DateTime(), nullable=True),
    sa.Column('datetime_upd', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['id_test'], ['test.id'], ),
    sa.ForeignKeyConstraint(['id_user'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_result_datetime_red'), 'result', ['datetime_red'], unique=False)
    # ### end Alembic commands ###


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

add table for tests results  Revision ID: 39f35c43a242 Revises: 01ab5b43e4bb Create Date: 2021-04-12 18:35:36.629415 # 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 ###