"""
Copyright (c) 2015 Michael Bright and Bamboo HR LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

action_configs

Revision ID: cdb13c1069ee
Revises: 86beaee286d5
Create Date: 2019-09-25 10:55:52.728988

"""

# revision identifiers, used by Alembic.
revision = 'cdb13c1069ee'
down_revision = '86beaee286d5'
branch_labels = None
depends_on = None

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

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('action_configs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('action_id', sa.Integer(), nullable=False),
    sa.Column('configuration', sa.Text(), nullable=False),
    sa.ForeignKeyConstraint(['action_id'], ['actions.id'], ),
    sa.PrimaryKeyConstraint('id'),
    mysql_engine='InnoDB'
    )
    op.create_index(op.f('ix_action_configs_action_id'), 'action_configs', ['action_id'], unique=False)
    op.create_index(op.f('ix_action_configs_id'), 'action_configs', ['id'], unique=False)
    op.create_table('action_instance_configs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('action_instance_id', sa.Integer(), nullable=False),
    sa.Column('configuration', sa.Text(), nullable=False),
    sa.ForeignKeyConstraint(['action_instance_id'], ['action_instances.id'], ),
    sa.PrimaryKeyConstraint('id'),
    mysql_engine='InnoDB'
    )
    op.create_index(op.f('ix_action_instance_configs_action_instance_id'), 'action_instance_configs', ['action_instance_id'], unique=False)
    op.create_index(op.f('ix_action_instance_configs_id'), 'action_instance_configs', ['id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_action_instance_configs_id'), table_name='action_instance_configs')
    op.drop_index(op.f('ix_action_instance_configs_action_instance_id'), table_name='action_instance_configs')
    op.drop_table('action_instance_configs')
    op.drop_index(op.f('ix_action_configs_id'), table_name='action_configs')
    op.drop_index(op.f('ix_action_configs_action_id'), table_name='action_configs')
    op.drop_table('action_configs')
    # ### end Alembic commands ###
