diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-03 08:21:06 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-03 08:21:06 +0300 |
commit | 30464bceaac08bf7a8415df7d3b1e0ddf6182762 (patch) | |
tree | 39a5ac6dc729edc105d7654835ac66d9aa16599d /db/migrate | |
parent | 9ad20891435f1f51ae6e8e951b84131480d1ab97 (diff) | |
parent | b2e1b70927f94a50a83e5afef359775894bd6b03 (diff) |
Merge branch 'master' into live-trace-v2
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb | 16 | ||||
-rw-r--r-- | db/migrate/20180417101940_add_index_to_ci_stage.rb | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb b/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb new file mode 100644 index 00000000000..ee82c70ecf8 --- /dev/null +++ b/db/migrate/20180417101040_add_tmp_stage_priority_index_to_ci_builds.rb @@ -0,0 +1,16 @@ +class AddTmpStagePriorityIndexToCiBuilds < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index(:ci_builds, [:stage_id, :stage_idx], + where: 'stage_idx IS NOT NULL', name: 'tmp_build_stage_position_index') + end + + def down + remove_concurrent_index_by_name(:ci_builds, 'tmp_build_stage_position_index') + end +end diff --git a/db/migrate/20180417101940_add_index_to_ci_stage.rb b/db/migrate/20180417101940_add_index_to_ci_stage.rb new file mode 100644 index 00000000000..9dac78db774 --- /dev/null +++ b/db/migrate/20180417101940_add_index_to_ci_stage.rb @@ -0,0 +1,9 @@ +class AddIndexToCiStage < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + add_column :ci_stages, :position, :integer + end +end |