From 6a7b20d9e30a90db2028254ffb0507b467899da7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 06 2019 10:59:27 +0000 Subject: Drop commit_flags_uid_key from commit_flags We enforce the commit flag to be unique per PR or per commit. We removed it from the PR flags table in dc4c195ceb1b399676a0dca5da9e72914bea1241 but we didn't remove it from the commit flags table... until now. Fixes https://pagure.io/pagure/issue/4446 Signed-off-by: Pierre-Yves Chibon --- diff --git a/alembic/versions/802047d28f89_drop_unique_constraint_on_commit_uid.py b/alembic/versions/802047d28f89_drop_unique_constraint_on_commit_uid.py new file mode 100644 index 0000000..7c6b721 --- /dev/null +++ b/alembic/versions/802047d28f89_drop_unique_constraint_on_commit_uid.py @@ -0,0 +1,28 @@ +"""Drop unique constraint on commit UID + +Revision ID: 802047d28f89 +Revises: 5a2327825b9a +Create Date: 2019-05-06 12:52:25.221300 + +""" + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '802047d28f89' +down_revision = '5a2327825b9a' + + +def upgrade(): + """ Remove the constraint named: commit_flags_uid_key, pass otherwise. """ + try: + op.drop_constraint('commit_flags_uid_key', 'commit_flags') + except: + pass + + +def downgrade(): + """ We do not want to go back in fact. """ + pass