diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-09 20:30:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-09 20:30:09 +0300 |
commit | 858d175c1527d650ea5d83e201777d0cf8ae84c9 (patch) | |
tree | 147344d5699ea84eda6f980867e4d2045e0f22b9 /lib/gitlab | |
parent | f6262510e6642bb91d112f1bf2ea70db8b7b772c (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-ee
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/database/migration_helpers.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index 9c1cb8e352c..9b041c18da4 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -367,12 +367,12 @@ module Gitlab def foreign_key_exists?(source, target = nil, **options) # This if block is necessary because foreign_key_exists? is called in down migrations that may execute before - # the postgres_foreign_keys view had necessary columns added, or even before the view existed. + # the postgres_foreign_keys view had necessary columns added. # In that case, we revert to the previous behavior of this method. # The behavior in the if block has a bug: it always returns false if the fk being checked has multiple columns. # This can be removed after init_schema.rb passes 20221122210711_add_columns_to_postgres_foreign_keys.rb # Tracking issue: https://gitlab.com/gitlab-org/gitlab/-/issues/386796 - if ActiveRecord::Migrator.current_version < 20221122210711 + unless connection.column_exists?('postgres_foreign_keys', 'constrained_table_name') return foreign_keys(source).any? do |foreign_key| tables_match?(target.to_s, foreign_key.to_table.to_s) && options_match?(foreign_key.options, options) |