"""empty message

Revision ID: bf06d46dfb3b
Revises: caad50404258
Create Date: 2019-08-25 14:07:41.556224

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

# revision identifiers, used by Alembic.
revision = 'bf06d46dfb3b'
down_revision = 'caad50404258'
branch_labels = None
depends_on = None


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def upgrade_users():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_foreign_key(None, 'roles_users', 'role', ['role_id'], ['id'])
    op.create_foreign_key(None, 'roles_users', 'user', ['user_id'], ['id'])
    # ### end Alembic commands ###


def downgrade_users():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'roles_users', type_='foreignkey')
    op.drop_constraint(None, 'roles_users', type_='foreignkey')
    # ### end Alembic commands ###


def upgrade_assets():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('downloads', 'img')
    op.add_column('job_vacancy', sa.Column('company', sa.String(length=200), nullable=False))
    op.add_column('job_vacancy', sa.Column('gender', sa.String(length=20), nullable=False))
    op.add_column('job_vacancy', sa.Column('job_description', sa.Text(), nullable=False))
    op.add_column('job_vacancy', sa.Column('job_summary', sa.Text(), nullable=False))
    op.add_column('job_vacancy', sa.Column('job_type', sa.String(length=50), nullable=False))
    op.add_column('job_vacancy', sa.Column('key_skills', sa.String(length=50), nullable=False))
    op.add_column('job_vacancy', sa.Column('location', sa.String(length=50), nullable=False))
    op.add_column('job_vacancy', sa.Column('no_of_opening', sa.Integer(), nullable=False))
    op.add_column('job_vacancy', sa.Column('preferable', sa.String(length=20), nullable=False))
    op.add_column('job_vacancy', sa.Column('priority', sa.String(length=20), nullable=False))
    op.add_column('job_vacancy', sa.Column('salary_range', sa.String(length=50), nullable=False))
    op.alter_column('job_vacancy', 'experience',
               existing_type=mysql.VARCHAR(length=200),
               nullable=False)
    op.drop_column('job_vacancy', 'education_requirements')
    op.drop_column('job_vacancy', 'salary')
    op.drop_column('job_vacancy', 'description')
    op.drop_column('job_vacancy', 'required')
    op.drop_column('job_vacancy', 'opening')
    # ### end Alembic commands ###


def downgrade_assets():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('job_vacancy', sa.Column('opening', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
    op.add_column('job_vacancy', sa.Column('required', mysql.VARCHAR(length=10), nullable=True))
    op.add_column('job_vacancy', sa.Column('description', mysql.TEXT(), nullable=False))
    op.add_column('job_vacancy', sa.Column('salary', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.add_column('job_vacancy', sa.Column('education_requirements', mysql.TEXT(), nullable=False))
    op.alter_column('job_vacancy', 'experience',
               existing_type=mysql.VARCHAR(length=200),
               nullable=True)
    op.drop_column('job_vacancy', 'salary_range')
    op.drop_column('job_vacancy', 'priority')
    op.drop_column('job_vacancy', 'preferable')
    op.drop_column('job_vacancy', 'no_of_opening')
    op.drop_column('job_vacancy', 'location')
    op.drop_column('job_vacancy', 'key_skills')
    op.drop_column('job_vacancy', 'job_type')
    op.drop_column('job_vacancy', 'job_summary')
    op.drop_column('job_vacancy', 'job_description')
    op.drop_column('job_vacancy', 'gender')
    op.drop_column('job_vacancy', 'company')
    op.add_column('downloads', sa.Column('img', mysql.VARCHAR(length=20), nullable=False))
    # ### end Alembic commands ###


def upgrade_connection():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_connection():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

