"""empty message

Revision ID: 9626163ab1b8
Revises: 
Create Date: 2021-01-14 16:29:36.810952

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '9626163ab1b8'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('course',
    sa.Column('course_id', sa.Integer(), nullable=False),
    sa.Column('course_name', sa.Text(), nullable=True),
    sa.Column('course_description', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('course_id')
    )
    op.create_table('course_material',
    sa.Column('course_id', sa.Integer(), nullable=False),
    sa.Column('material_id', sa.Integer(), nullable=False),
    sa.Column('material_name', sa.Text(), nullable=True),
    sa.Column('content', sa.Text(), nullable=True),
    sa.Column('add_date', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('course_id', 'material_id')
    )
    op.create_table('group',
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('group_name', sa.String(length=64), nullable=True),
    sa.Column('faculty_name', sa.String(length=64), nullable=True),
    sa.Column('course_num', sa.Integer(), nullable=True),
    sa.Column('year_of_formation', sa.Integer(), nullable=True),
    sa.Column('degree', sa.String(length=64), nullable=True),
    sa.Column('form_of_education', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('group_id')
    )
    op.create_table('group_x_course',
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('course_id', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('group_id', 'course_id')
    )
    op.create_table('homework',
    sa.Column('hw_id', sa.Integer(), nullable=False),
    sa.Column('course_id', sa.Integer(), nullable=False),
    sa.Column('hw_name', sa.Text(), nullable=True),
    sa.Column('hw_description', sa.Text(), nullable=True),
    sa.Column('time_start', sa.DateTime(), nullable=True),
    sa.Column('time_end', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('hw_id', 'course_id')
    )
    op.create_table('student',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('year_of_entry', sa.Integer(), nullable=True),
    sa.Column('basis_of_education', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('user_id', 'group_id')
    )
    op.create_table('student_x_hw',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('hw_id', sa.Integer(), nullable=False),
    sa.Column('solution', sa.Text(), nullable=True),
    sa.Column('time_send', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('user_id', 'hw_id')
    )
    op.create_table('user',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('code', sa.String(length=64), nullable=True),
    sa.Column('user_role', sa.String(length=64), nullable=True),
    sa.Column('email', sa.Text(), nullable=True),
    sa.Column('password', sa.String(length=64), nullable=True),
    sa.Column('First_name', sa.String(length=64), nullable=True),
    sa.Column('Surname', sa.String(length=64), nullable=True),
    sa.Column('Middle_name', sa.String(length=64), nullable=True),
    sa.Column('telephone', sa.String(length=64), nullable=True),
    sa.Column('city', sa.String(length=64), nullable=True),
    sa.Column('information', sa.Text(), nullable=True),
    sa.Column('vk', sa.Text(), nullable=True),
    sa.Column('facebook', sa.Text(), nullable=True),
    sa.Column('linkedIn', sa.Text(), nullable=True),
    sa.Column('instagram', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('user_id'),
    sa.UniqueConstraint('code')
    )
    op.create_table('user_x_course',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('course_id', sa.Integer(), nullable=False),
    sa.Column('course_role', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('user_id', 'course_id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_x_course')
    op.drop_table('user')
    op.drop_table('student_x_hw')
    op.drop_table('student')
    op.drop_table('homework')
    op.drop_table('group_x_course')
    op.drop_table('group')
    op.drop_table('course_material')
    op.drop_table('course')
    # ### end Alembic commands ###
