"""empty message

Revision ID: d6814cf6e6d5
Revises: 243b8fdb2de9
Create Date: 2019-10-04 10:37:45.098472

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd6814cf6e6d5'
down_revision = '243b8fdb2de9'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('chapters',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.Text(), nullable=False),
    sa.Column('order_number', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('questions', sa.Column('chapter_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'questions', 'chapters', ['chapter_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'questions', type_='foreignkey')
    op.drop_column('questions', 'chapter_id')
    op.drop_table('chapters')
    # ### end Alembic commands ###
