"""empty message

Revision ID: 302d8824f6c3
Revises: 
Create Date: 2019-10-16 23:21:07.106187

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '302d8824f6c3'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('admin',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('admin_uuid', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('password', sa.String(length=255), nullable=True),
    sa.Column('password_hash', sa.String(length=255), nullable=True),
    sa.Column('time_login', sa.DateTime(), nullable=True),
    sa.Column('time_logout', sa.DateTime(), nullable=True),
    sa.Column('time_created', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id', 'admin_uuid'),
    sa.UniqueConstraint('admin_uuid')
    )
    op.create_table('history_student',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('history_uuid', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('subject', sa.String(length=255), nullable=True),
    sa.Column('tutor', sa.String(length=255), nullable=True),
    sa.Column('number_learning', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id', 'history_uuid'),
    sa.UniqueConstraint('history_uuid'),
    sa.UniqueConstraint('id')
    )
    op.create_table('students',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('student_uuid', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('full_name', sa.String(length=255), nullable=True),
    sa.Column('email', sa.String(length=255), nullable=True),
    sa.Column('password', sa.String(length=255), nullable=True),
    sa.Column('password_hash', sa.String(length=255), nullable=True),
    sa.Column('gender', sa.String(length=255), nullable=True),
    sa.Column('grade', sa.String(length=255), nullable=True),
    sa.Column('phone_number', sa.String(length=255), nullable=True),
    sa.Column('school', sa.String(length=255), nullable=True),
    sa.Column('address', sa.String(length=255), nullable=True),
    sa.Column('status_login', sa.Boolean(), nullable=True),
    sa.Column('activation', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.Column('time_login', sa.DateTime(), nullable=True),
    sa.Column('time_logout', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id', 'student_uuid'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('student_uuid')
    )
    op.create_table('tutors',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('tutor_uuid', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('full_name', sa.String(length=255), nullable=True),
    sa.Column('email', sa.String(length=255), nullable=True),
    sa.Column('phone_number', sa.String(length=255), nullable=True),
    sa.Column('password', sa.String(length=255), nullable=True),
    sa.Column('password_hash', sa.String(length=255), nullable=True),
    sa.Column('address', sa.String(length=255), nullable=True),
    sa.Column('education', sa.String(length=255), nullable=True),
    sa.Column('experience', sa.Text(), nullable=True),
    sa.Column('gender', sa.String(length=100), nullable=True),
    sa.Column('status_login', sa.Boolean(), nullable=True),
    sa.Column('is_working', sa.Boolean(), nullable=True),
    sa.Column('activation', sa.Boolean(), nullable=True),
    sa.Column('number_like', sa.Integer(), nullable=True),
    sa.Column('number_dislike', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.Column('time_login', sa.DateTime(), nullable=True),
    sa.Column('time_logout', sa.DateTime(), nullable=True),
    sa.Column('time_tutor_on', sa.DateTime(), nullable=True),
    sa.Column('time_tutor_off', sa.DateTime(), nullable=True),
    sa.Column('time_unactivated', sa.DateTime(), nullable=True),
    sa.Column('time_reactivated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id', 'tutor_uuid'),
    sa.UniqueConstraint('email'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('tutor_uuid')
    )
    op.create_table('subjects',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('subject_uuid', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('name_subject', sa.String(length=255), nullable=True),
    sa.Column('price', sa.Integer(), nullable=True),
    sa.Column('description', sa.Text(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('tutor', postgresql.UUID(as_uuid=True), nullable=True),
    sa.ForeignKeyConstraint(['tutor'], ['tutors.tutor_uuid'], ),
    sa.PrimaryKeyConstraint('id', 'subject_uuid'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('subject_uuid')
    )
    op.create_table('summaries',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('summary_uuid', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('topic', sa.Text(), nullable=True),
    sa.Column('date', sa.DateTime(), nullable=True),
    sa.Column('time_started', sa.DateTime(), nullable=True),
    sa.Column('time_ended', sa.DateTime(), nullable=True),
    sa.Column('sign_student', sa.Boolean(), nullable=True),
    sa.Column('sign_tutor', sa.Boolean(), nullable=True),
    sa.Column('remarks', sa.Text(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('deleted_at', sa.DateTime(), nullable=True),
    sa.Column('status', sa.Boolean(), nullable=True),
    sa.Column('student', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('tutor', postgresql.UUID(as_uuid=True), nullable=True),
    sa.ForeignKeyConstraint(['student'], ['students.student_uuid'], ),
    sa.ForeignKeyConstraint(['tutor'], ['tutors.tutor_uuid'], ),
    sa.PrimaryKeyConstraint('id', 'summary_uuid'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('summary_uuid')
    )
    op.create_table('tutoring',
    sa.Column('subject_uuid', postgresql.UUID(as_uuid=True), nullable=True),
    sa.Column('student_uuid', postgresql.UUID(as_uuid=True), nullable=True),
    sa.ForeignKeyConstraint(['student_uuid'], ['students.student_uuid'], ),
    sa.ForeignKeyConstraint(['subject_uuid'], ['subjects.subject_uuid'], )
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tutoring')
    op.drop_table('summaries')
    op.drop_table('subjects')
    op.drop_table('tutors')
    op.drop_table('students')
    op.drop_table('history_student')
    op.drop_table('admin')
    # ### end Alembic commands ###
