"""Update quizgameresults and quizgame_question_scores Tables

Revision ID: d8d25eaedd3f
Revises: 4<PASSWORD>
Create Date: 2021-07-10 18:24:08.846197

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd<PASSWORD>'
down_revision = '4<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('quiz_game_question_scores', sa.Column('assigned_user_id', sa.Integer(), nullable=False))
    op.create_foreign_key(None, 'quiz_game_question_scores', 'users', ['assigned_user_id'], ['id'])
    op.add_column('quiz_game_results', sa.Column('amount_of_questions', sa.Integer(), nullable=False))
    op.add_column('quiz_game_results', sa.Column('amount_of_correct_questions', sa.Integer(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('quiz_game_results', 'amount_of_correct_questions')
    op.drop_column('quiz_game_results', 'amount_of_questions')
    op.drop_constraint(None, 'quiz_game_question_scores', type_='foreignkey')
    op.drop_column('quiz_game_question_scores', 'assigned_user_id')
    # ### end Alembic commands ###

"""Update quizgameresults and quizgame_question_scores Tables

Revision ID: d8d25eaedd3f
Revises: 4<PASSWORD>
Create Date: 2021-07-10 18:24:08.846197

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd<PASSWORD>'
down_revision = '4<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('quiz_game_question_scores', sa.Column('assigned_user_id', sa.Integer(), nullable=False))
    op.create_foreign_key(None, 'quiz_game_question_scores', 'users', ['assigned_user_id'], ['id'])
    op.add_column('quiz_game_results', sa.Column('amount_of_questions', sa.Integer(), nullable=False))
    op.add_column('quiz_game_results', sa.Column('amount_of_correct_questions', sa.Integer(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('quiz_game_results', 'amount_of_correct_questions')
    op.drop_column('quiz_game_results', 'amount_of_questions')
    op.drop_constraint(None, 'quiz_game_question_scores', type_='foreignkey')
    op.drop_column('quiz_game_question_scores', 'assigned_user_id')
    # ### end Alembic commands ###

Update quizgameresults and quizgame_question_scores Tables  Revision ID: d8d25eaedd3f Revises: 4<PASSWORD> Create Date: 2021-07-10 18:24:08.846197 # 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 ###