Skip to content

Migration to add unique index to external_services

Warren Gifford requested to merge mv/unique-index-to-external-service into main

Created by: miveronese

This PR adds a unique index on external_service.kind, external_service.namespace_org_id so we can enforce the limit also in the DB level. The API already has a check to avoid more than one external service of type Gitlab or Gitthub. For more context, see Cloud-150 and also this old Draft PR.

Test plan

Tested the queries in a local instance and all worked as expected.

Merge request reports

Loading