Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-18 18:09:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-18 18:09:26 +0300
commitb6b9abb7cdb61f18d6fc5222e52486d7f6c482dc (patch)
tree1515d3bd2dec5e8f2705212f4548d3d8e6259a49 /spec/db
parentba12560b3fcd6e24d0ab7e14ae71917a9a81f6aa (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/db')
-rw-r--r--spec/db/schema_spec.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb
index e4a0ccdb57f..e69074fd068 100644
--- a/spec/db/schema_spec.rb
+++ b/spec/db/schema_spec.rb
@@ -17,6 +17,22 @@ RSpec.describe 'Database schema', feature_category: :database do
TABLE_PARTITIONS = %w[ci_builds_metadata].freeze
+ # If splitting FK and table removal into two MRs as suggested in the docs, use this constant in the initial FK removal MR.
+ # In the subsequent table removal MR, remove the entries.
+ # See: https://docs.gitlab.com/ee/development/migration_style_guide.html#dropping-a-database-table
+ REMOVED_FKS = {
+ clusters_applications_cert_managers: %w[cluster_id],
+ clusters_applications_cilium: %w[cluster_id],
+ clusters_applications_crossplane: %w[cluster_id],
+ clusters_applications_helm: %w[cluster_id],
+ clusters_applications_ingress: %w[cluster_id],
+ clusters_applications_jupyter: %w[cluster_id oauth_application_id],
+ clusters_applications_knative: %w[cluster_id],
+ clusters_applications_prometheus: %w[cluster_id],
+ clusters_applications_runners: %w[cluster_id],
+ serverless_domain_cluster: %w[clusters_applications_knative_id creator_id pages_domain_id]
+ }.with_indifferent_access.freeze
+
# List of columns historically missing a FK, don't add more columns
# See: https://docs.gitlab.com/ee/development/database/foreign_keys.html#naming-foreign-keys
IGNORED_FK_COLUMNS = {
@@ -371,7 +387,7 @@ RSpec.describe 'Database schema', feature_category: :database do
end
def ignored_fk_columns(table)
- IGNORED_FK_COLUMNS.fetch(table, [])
+ REMOVED_FKS.merge(IGNORED_FK_COLUMNS).fetch(table, [])
end
def ignored_index_columns(table)