"""updated posts unique constraint

Revision ID: 8dc647c9aca4
Revises: 46f8a36a9d9b
Create Date: 2021-09-07 13:07:45.938489

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '8dc647c9aca4'
down_revision = '46f8a36a9d9b'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('posts_title_key', 'posts', type_='unique')
    op.create_unique_constraint('post_title_author_site_unique', 'posts', ['title', 'author_id', 'site_id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_unique_constraint('posts_title_key', 'posts', ['title'])
    op.drop_constraint('post_title_author_site_unique', 'posts', type_='unique')
    # ### end Alembic commands ###
