#4459 Drop commit_flags_uid_key from commit_flags
Merged 2 years ago by pingou. Opened 2 years ago by pingou.

@@ -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

We enforce the commit flag to be unique per PR or per commit.
We removed it from the PR flags table in dc4c195
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 pingou@pingoured.fr

rebased onto 6a7b20d

2 years ago

Pull-Request has been merged by pingou

2 years ago