Add uniqueness check per project_id on push rule creation

What does this MR do and why?

Contributes to #493391

Problem

project_id column is not checked for uniqueness and database has duplicated records.

Solution

Block the creation of push rule records when push rules for project are already defined.

References

Push rules: add a unique index by project_id (#493391)

Screenshots or screen recordings

Before After
Screenshot_2025-07-25_at_15.34.56 Screenshot_2025-07-25_at_15.35.10

How to set up and validate locally

  1. Go to Create new project page
  2. Use Create from template
  3. Select NodeJS Express template
  4. Create project
  5. Project will have multiple push rules records (before the fix)

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #493391

Edited by Vasilii Iakliushin

Merge request reports

Loading