Define naming convention for custom database constraints
What does this MR do?
Up to recently, the only application relying on a database was GitLab Rails. With Rails, the most common option is to let the ORM pick the name for new database constraints whenever possible or let PostgreSQL use the defaults (if applicable).
Gitaly Praefect now has a PostgreSQL database, and the Container Registry is about to have one as well. Both are Go applications, and following our development guidelines, no Go application uses an ORM.
For this reason, and speaking about the registry, we found the need to come up with a naming convention for database constraints for better consistency and discoverability. For this reason, and because there are currently no guidelines around this in the database development docs, we started by using an internal naming convention for the registry.
After receiving feedback from @iroussos in regards to possible improvements for the naming conventions (container-registry!407 (comment 443083456)), we decided to create this MR to discuss them and propose their addition to the database development docs, as they might be useful for GitLab Rails and other Go applications as well.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team