"""tag owner foreign key should be user.id not tag.id

Revision ID: cceef243c7e2
Revises: 026f4084592c
Create Date: 2020-03-07 21:45:42.981378

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'cceef243c7e2'
down_revision = '026f4084592c'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('tag_owner_id_fkey', 'tag', type_='foreignkey')
    op.create_foreign_key(None, 'tag', 'user', ['owner_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'tag', type_='foreignkey')
    op.create_foreign_key('tag_owner_id_fkey', 'tag', 'tag', ['owner_id'], ['id'])
    # ### end Alembic commands ###
