"""empty message

Revision ID: d6e8f757365d
Revises: 6f36ef2f4798
Create Date: 2020-09-05 18:26:50.952052

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

# revision identifiers, used by Alembic.
revision = 'd6e8f757365d'
down_revision = '6f36ef2f4798'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cars',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('domain', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_table('users')
    op.drop_table('Schools')
    op.drop_table('ExamTypes')
    op.drop_table('Packages')
    op.drop_table('Emails')
    op.drop_table('PackageDetail')
    op.drop_table('UserGeneral')
    op.drop_table('knex_migrations')
    op.drop_table('knex_migrations_lock')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('knex_migrations_lock',
    sa.Column('index', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('is_locked', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('index', name='knex_migrations_lock_pkey')
    )
    op.create_table('knex_migrations',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('name', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('batch', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('migration_time', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='knex_migrations_pkey')
    )
    op.create_table('UserGeneral',
    sa.Column('Id', sa.INTEGER(), server_default=sa.text('nextval(\'"UserGeneral_Id_seq"\'::regclass)'), autoincrement=True, nullable=False),
    sa.Column('Name', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('Surname', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('Password', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('Phone', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('Mail', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('Age', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('SchoolId', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('Class', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('ExamTypeId', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('PackageDetailId', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('ExamType', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['ExamType'], ['ExamTypes.Id'], name='UserGeneral_ExamType_fkey', onupdate='RESTRICT', ondelete='RESTRICT'),
    sa.ForeignKeyConstraint(['PackageDetailId'], ['PackageDetail.Id'], name='UserGeneral_PackageDetailId_fkey', onupdate='RESTRICT', ondelete='RESTRICT'),
    sa.ForeignKeyConstraint(['SchoolId'], ['Schools.Id'], name='UserGeneral_SchoolId_fkey', onupdate='RESTRICT', ondelete='RESTRICT'),
    sa.PrimaryKeyConstraint('Id', name='UserGeneral_pkey')
    )
    op.create_table('PackageDetail',
    sa.Column('Id', sa.INTEGER(), server_default=sa.text('nextval(\'"PackageDetail_Id_seq"\'::regclass)'), autoincrement=True, nullable=False),
    sa.Column('PackageId', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('PackageStart', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('PackageEnd', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('HasExtraPackage', sa.BOOLEAN(), autoincrement=False, nullable=False),
    sa.Column('ExtraPackageStart', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('ExtraPackageEnd', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('AppScore', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('ExtraPackageId', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('Id', name='PackageDetail_pkey')
    )
    op.create_table('Emails',
    sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"Emails_id_seq"\'::regclass)'), autoincrement=True, nullable=False),
    sa.Column('email', sa.TEXT(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id', name='Emails_pkey'),
    sa.UniqueConstraint('email', name='Emails_email_key')
    )
    op.create_table('Packages',
    sa.Column('Id', sa.INTEGER(), server_default=sa.text('nextval(\'"Packages_Id_seq"\'::regclass)'), autoincrement=True, nullable=False),
    sa.Column('Name', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('Duration', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('Id', name='Packages_pkey')
    )
    op.create_table('ExamTypes',
    sa.Column('Id', sa.INTEGER(), server_default=sa.text('nextval(\'"ExamTypes_Id_seq"\'::regclass)'), autoincrement=True, nullable=False),
    sa.Column('ExamName', sa.TEXT(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('Id', name='ExamTypes_pkey'),
    sa.UniqueConstraint('ExamName', name='ExamTypes_ExamName_key')
    )
    op.create_table('Schools',
    sa.Column('Id', sa.INTEGER(), server_default=sa.text('nextval(\'"Schools_Id_seq"\'::regclass)'), autoincrement=True, nullable=False),
    sa.Column('City', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('District', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('Name', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('SchoolType', sa.TEXT(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('Id', name='Schools_pkey')
    )
    op.create_table('users',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('username', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('password', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('token', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), server_default=sa.text('now()'), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('id', name='users_pkey'),
    sa.UniqueConstraint('username', name='users_username_unique')
    )
    op.drop_table('cars')
    # ### end Alembic commands ###
