"""empty message

Revision ID: aa78a0f129e9
Revises: a8e6057aa3ba
Create Date: 2020-05-25 16:44:12.478568

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'aa78a0f129e9'
down_revision = 'a8e6057aa3ba'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    category_table = op.create_table('categories',
                                     sa.Column('id', sa.Integer(), nullable=False),
                                     sa.Column('type', sa.String(), nullable=False),
                                     sa.PrimaryKeyConstraint('id')
                                     )
    question_table = op.create_table('questions',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('question', sa.String(), nullable=False),
                    sa.Column('answer', sa.String(), nullable=False),
                    sa.Column('category_id', sa.Integer(), nullable=False),
                    sa.Column('difficulty', sa.Integer(), nullable=False),
                    sa.ForeignKeyConstraint(['category_id'], ['categories.id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.bulk_insert(category_table, [
        {'id': 1, 'type': 'Science'},
        {'id': 2, 'type': 'Art'},
        {'id': 3, 'type': 'Geography'},
        {'id': 4, 'type': 'History'},
        {'id': 5, 'type': 'Entertainment'},
        {'id': 6, 'type': 'Sport'}
    ])
    op.bulk_insert(question_table, [
        {'id': 1, 'question': 'Whose autobiography is entitled \'I know why the Caged Bird Sings\'?', 'answer': 'Maya Angelou', 'difficulty': 2, 'category_id': 4},
        {'id': 2, 'question': 'What boxer\'s original name is Cassius Clay?', 'answer': 'Muhammad Ali', 'difficulty': 1, 'category_id': 4},
        {'id': 3, 'question': 'What movie earned Tom Hanks his third straight Oscar nomination, in 1996?', 'answer': 'Apollo 13', 'difficulty': 4, 'category_id': 5},
        {'id': 4, 'question': 'What actor did author Anne Rice first denounce, then praise in the role of her beloved Lestat?', 'answer': 'Tom Cruise', 'difficulty': 4, 'category_id': 5},
        {'id': 5, 'question': 'What was the title of the 1990 fantasy directed by Tim Burton about a young man with multi-bladed appendages?', 'answer': 'Edward Scissorhands', 'difficulty': 3, 'category_id': 5},
        {'id': 6, 'question': 'Which is the only team to play in every soccer World Cup tournament?', 'answer': 'Brazil', 'difficulty': 3, 'category_id': 6},
        {'id': 7, 'question': 'Which country won the first ever soccer World Cup in 1930?', 'answer': 'Uruguay', 'difficulty': 4, 'category_id': 6},
        {'id': 8, 'question': 'Who invented Peanut Butter?', 'answer': 'George Washington Carver', 'difficulty': 2, 'category_id': 4},
        {'id': 9, 'question': 'What is the largest lake in Africa?', 'answer': 'Lake Victoria', 'difficulty': 2, 'category_id': 3},
        {'id': 10, 'question': 'In which royal palace would you find the Hall of Mirrors?', 'answer': 'The Palace of Versailles', 'difficulty': 3, 'category_id': 3},
        {'id': 11, 'question': 'The Taj Mahal is located in which Indian city?', 'answer': 'Agra', 'difficulty': 2, 'category_id': 3},
        {'id': 12, 'question': 'Which Dutch graphic artist-initials M C was a creator of optical illusions?', 'answer': 'Escher', 'difficulty': 1, 'category_id': 2},
        {'id': 13, 'question': 'La Giaconda is better known as what?', 'answer': 'Mona Lisa', 'difficulty': 3, 'category_id': 2},
        {'id': 14, 'question': 'How many paintings did Van Gogh sell in his lifetime?', 'answer': 'One', 'difficulty': 4, 'category_id': 2},
        {'id': 15, 'question': 'Which American artist was a pioneer of Abstract Expressionism, and a leading exponent of action painting?', 'answer': 'Jackson Pollock', 'difficulty': 2, 'category_id': 2},
        {'id': 16, 'question': 'What is the heaviest organ in the human body?', 'answer': 'The Liver', 'difficulty': 4, 'category_id': 1},
        {'id': 17, 'question': 'Who discovered penicillin?', 'answer': 'Alexander Fleming', 'difficulty': 3, 'category_id': 1},
        {'id': 18, 'question': 'Hematology is a branch of medicine involving the study of what?', 'answer': 'Blood', 'difficulty': 4, 'category_id': 1},
        {'id': 19, 'question': 'Which dung beetle was worshipped by the ancient Egyptians?', 'answer': 'Scarab', 'difficulty': 4, 'category_id': 4}
    ])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('questions')
    op.drop_table('categories')
    # ### end Alembic commands ###
