diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-22 15:10:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-22 15:10:38 +0300 |
commit | 980d813e90c70f09861e39b9269e73b2c9a4e936 (patch) | |
tree | 56bbceba907009181439a7c3a0855418b965b39e /spec/db | |
parent | 2e9f877e8b6dd58c8011745b1d9a28dd67c8179c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/db')
-rw-r--r-- | spec/db/schema_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb index b2c77a06f19..2f0f7376206 100644 --- a/spec/db/schema_spec.rb +++ b/spec/db/schema_spec.rb @@ -102,7 +102,12 @@ RSpec.describe 'Database schema' do context 'all foreign keys' do # for index to be effective, the FK constraint has to be at first place it 'are indexed' do - first_indexed_column = indexes.map(&:columns).map(&:first) + first_indexed_column = indexes.map(&:columns).map do |columns| + # In cases of complex composite indexes, a string is returned eg: + # "lower((extern_uid)::text), group_id" + columns = columns.split(',') if columns.is_a?(String) + columns.first.chomp + end foreign_keys_columns = foreign_keys.map(&:column) # Add the primary key column to the list of indexed columns because |