"""changed application audit table

Revision ID: 79cd9609e994
Revises: ce352567e48f
Create Date: 2020-08-21 14:20:44.014688

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '79cd9609e994'
down_revision = 'ce352567e48f'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('application_audit', sa.Column('created', sa.DateTime(), nullable=False))
    op.add_column('application', sa.Column('form_url', sa.String(length=500), nullable=True))
    op.add_column('application_audit', sa.Column('form_url', sa.String(length=500), nullable=False))
    op.alter_column('application_audit', 'application_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.drop_column('application_audit', 'application_name')
    op.drop_column('application_audit', 'form_process_mapper_id')
    op.drop_column('application_audit', 'form_submission_id')
    op.drop_column('application_audit', 'revision_no')
    op.drop_column('application_audit', 'process_instance_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('application_audit', sa.Column('process_instance_id', sa.VARCHAR(length=30), autoincrement=False, nullable=False))
    op.add_column('application_audit', sa.Column('revision_no', sa.INTEGER(), autoincrement=False, nullable=False))
    op.add_column('application_audit', sa.Column('form_submission_id', sa.VARCHAR(length=30), autoincrement=False, nullable=False))
    op.add_column('application_audit', sa.Column('form_process_mapper_id', sa.INTEGER(), autoincrement=False, nullable=False))
    op.add_column('application_audit', sa.Column('application_name', sa.VARCHAR(length=500), autoincrement=False, nullable=False))
    op.alter_column('application_audit', 'application_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.drop_column('application_audit', 'form_url')
    op.drop_column('application_audit', 'created')
    # ### end Alembic commands ###
