"""missing_foreign_key_constraint

Revision: 0009
Revision ID: 3a5f18e53496
Revises: 2075f8467bf0
Create Date: 2015-06-17 15:21:27.987975

"""

# revision identifiers, used by Alembic.
revision = '3a5f18e53496'
down_revision = '2075f8467bf0'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=False)
    op.drop_constraint('board_templates_owner_id_fkey', 'board_templates')
    op.create_foreign_key(None, 'board_templates', 'organizations', ['owner_id'], ['id'], ondelete='CASCADE')


def downgrade():
    op.drop_index(op.f('ix_users_username'), table_name='users')
