"""revamp_keypairs

Revision ID: 4b8a66fb8d82
Revises: 854bd902b1bc
Create Date: 2017-09-13 01:57:42.355633

"""

from alembic import op

# revision identifiers, used by Alembic.
revision = "4b8a66fb8d82"
down_revision = "854bd902b1bc"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column("keypairs", column_name="billing_plan", new_column_name="resource_policy")
    op.create_index(op.f("ix_keypairs_is_active"), "keypairs", ["is_active"], unique=False)
    op.create_index(op.f("ix_keypairs_user_id"), "keypairs", ["user_id"], unique=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column("keypairs", column_name="resource_policy", new_column_name="billing_plan")
    op.drop_index(op.f("ix_keypairs_user_id"), table_name="keypairs")
    op.drop_index(op.f("ix_keypairs_is_active"), table_name="keypairs")
    # ### end Alembic commands ###
