diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-24 00:08:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-24 00:08:48 +0000 |
commit | 312d3ac2598495b455130247a1bea915cd5fc466 (patch) | |
tree | 2b048f0fe68ca75e38ced65e6b7c022b7586a9d2 /lib/gitlab/database/migration_helpers.rb | |
parent | 00ab3a60fed93cb3c6c9148d9c9c68fb11d325ee (diff) | |
download | gitlab-ce-312d3ac2598495b455130247a1bea915cd5fc466.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/database/migration_helpers.rb')
-rw-r--r-- | lib/gitlab/database/migration_helpers.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index c1f4b8d5e25..91199c55b1d 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -316,6 +316,13 @@ module Gitlab end end + # Since we may be migrating in one go from a previous version without + # `constrained_table_name` then we may see that this column exists + # (as above) but the schema cache is still outdated for the model. + unless Gitlab::Database::PostgresForeignKey.column_names.include?('constrained_table_name') + Gitlab::Database::PostgresForeignKey.reset_column_information + end + fks = Gitlab::Database::PostgresForeignKey.by_constrained_table_name_or_identifier(source) fks = fks.by_referenced_table_name(target) if target |