Commit e79784b7 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Create index on id instead of stage_id in migration

parent 2f3f9a6b
......@@ -4,11 +4,11 @@ class AddTmpPartialNullIndexToBuilds < ActiveRecord::Migration
disable_ddl_transaction!
def up
add_concurrent_index(:ci_builds, :stage_id, where: 'stage_id IS NULL',
name: 'tmp_stage_id_partial_null_index')
add_concurrent_index(:ci_builds, :id, where: 'stage_id IS NULL',
name: 'tmp_id_partial_null_index')
end
def down
remove_concurrent_index_by_name(:ci_builds, 'tmp_stage_id_partial_null_index')
remove_concurrent_index_by_name(:ci_builds, 'tmp_id_partial_null_index')
end
end
......@@ -4,11 +4,11 @@ class RemoveTmpPartialNullIndexFromBuilds < ActiveRecord::Migration
disable_ddl_transaction!
def up
remove_concurrent_index_by_name(:ci_builds, 'tmp_stage_id_partial_null_index')
remove_concurrent_index_by_name(:ci_builds, 'tmp_id_partial_null_index')
end
def down
add_concurrent_index(:ci_builds, :stage_id, where: 'stage_id IS NULL',
name: 'tmp_stage_id_partial_null_index')
add_concurrent_index(:ci_builds, :id, where: 'stage_id IS NULL',
name: 'tmp_id_partial_null_index')
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment