Merge branch 'sh-fix-issue-59985' into 'master'
Fix stage index migration failing in PostgreSQL 10 Closes #59985 See merge request gitlab-org/gitlab-ce!26972
This commit is contained in:
commit
b22a725a0c
|
@ -21,8 +21,8 @@ module Gitlab
|
|||
AND stage_idx IS NOT NULL
|
||||
GROUP BY stage_id, stage_idx
|
||||
), indexes AS (
|
||||
SELECT DISTINCT stage_id, last_value(stage_idx)
|
||||
OVER (PARTITION BY stage_id ORDER BY freq ASC) AS index
|
||||
SELECT DISTINCT stage_id, first_value(stage_idx)
|
||||
OVER (PARTITION BY stage_id ORDER BY freq DESC) AS index
|
||||
FROM freqs
|
||||
)
|
||||
|
||||
|
|
|
@ -30,6 +30,6 @@ describe Gitlab::BackgroundMigration::MigrateStageIndex, :migration, schema: 201
|
|||
|
||||
described_class.new.perform(100, 101)
|
||||
|
||||
expect(stages.all.pluck(:position)).to eq [2, 3]
|
||||
expect(stages.all.order(:id).pluck(:position)).to eq [2, 3]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue