[Data Integrity Issue] Lacking unique index on the `namespace_id` column in the `gitlab_subscriptions` table

The following discussion from !40537 (merged) should be addressed:

  • @dosuken123 started a discussion: (+3 comments)

    Does it make sense to add a test that duplicate gitlab_subscriptions are not created? So that we can prevent the further regression when the other developer removed the update_only?

    When do we insert the first gitlab_subscription record when a new namespace is created? Does it still work with the update_only: true option?

    Also, it looks like Namespace and GitlabSubscription is 1-to-1 relationship. Why don't we have a unique index on the database-level for ensuring the data integrity?