"""empty message

Revision ID: 2fd4f00bf38e
Revises: 
Create Date: 2020-06-08 02:14:06.251926

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2fd4f00bf38e'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('contenttype',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('key', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('epic',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('lessontype',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('key', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('materialtype',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('key', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('quiztype',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('key', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('resource',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('link', sa.String(), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('section',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('key', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('tag',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('key', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('lesson',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('text', sa.Text(), nullable=True),
    sa.Column('lesson_type', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['lesson_type'], ['lessontype.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('material',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('section', sa.Integer(), nullable=True),
    sa.Column('material_type', sa.Integer(), nullable=True),
    sa.Column('content_type', sa.Integer(), nullable=True),
    sa.Column('source', sa.String(), nullable=True),
    sa.Column('volume', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['content_type'], ['contenttype.id'], ),
    sa.ForeignKeyConstraint(['material_type'], ['materialtype.id'], ),
    sa.ForeignKeyConstraint(['section'], ['section.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('note',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('lesson', sa.Integer(), nullable=True),
    sa.Column('text', sa.Text(), nullable=True),
    sa.Column('date', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['lesson'], ['lesson.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('quiz',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('quiz_type', sa.Integer(), nullable=True),
    sa.Column('question', sa.String(), nullable=True),
    sa.Column('answer', sa.String(), nullable=True),
    sa.Column('material', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['material'], ['material.id'], ),
    sa.ForeignKeyConstraint(['quiz_type'], ['quiztype.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('story',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('order', sa.Integer(), nullable=True),
    sa.Column('epic', sa.Integer(), nullable=True),
    sa.Column('time_estimate', sa.Integer(), nullable=True),
    sa.Column('story_points', sa.Integer(), nullable=True),
    sa.Column('start_date', sa.DateTime(), nullable=True),
    sa.Column('end_date', sa.DateTime(), nullable=True),
    sa.Column('material', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['epic'], ['epic.id'], ),
    sa.ForeignKeyConstraint(['material'], ['material.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('timer',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('start_date', sa.DateTime(), nullable=True),
    sa.Column('end_date', sa.DateTime(), nullable=True),
    sa.Column('text', sa.Text(), nullable=True),
    sa.Column('lesson', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['lesson'], ['lesson.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('quizlog',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('quiz', sa.Integer(), nullable=True),
    sa.Column('date', sa.DateTime(), nullable=True),
    sa.Column('answer', sa.Text(), nullable=True),
    sa.Column('result', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['quiz'], ['quiz.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('quizlog')
    op.drop_table('timer')
    op.drop_table('story')
    op.drop_table('quiz')
    op.drop_table('note')
    op.drop_table('material')
    op.drop_table('lesson')
    op.drop_table('tag')
    op.drop_table('section')
    op.drop_table('resource')
    op.drop_table('quiztype')
    op.drop_table('materialtype')
    op.drop_table('lessontype')
    op.drop_table('epic')
    op.drop_table('contenttype')
    # ### end Alembic commands ###
