diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-08-31 11:01:43 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-03 17:49:10 +0300 |
commit | d3bf01608013eac24764c1dacd51f8b841dd9bf1 (patch) | |
tree | 34a3aee86168c0ae4c017de39bf8918dc7bfafbf /db | |
parent | a2cde2847c68e8061f6f40f106502fa164be7b02 (diff) |
Remove access_level index from runner. Add protected on ci_pipelines. Add protected index on ci_builds.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170816133939_add_index_on_ci_runners_access_level.rb | 15 | ||||
-rw-r--r-- | db/migrate/20170816143940_add_protected_to_ci_pipelines.rb | 7 | ||||
-rw-r--r-- | db/migrate/20170816153940_add_index_on_ci_builds_protected.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 5 |
4 files changed, 25 insertions, 17 deletions
diff --git a/db/migrate/20170816133939_add_index_on_ci_runners_access_level.rb b/db/migrate/20170816133939_add_index_on_ci_runners_access_level.rb deleted file mode 100644 index 4239bf6f9cb..00000000000 --- a/db/migrate/20170816133939_add_index_on_ci_runners_access_level.rb +++ /dev/null @@ -1,15 +0,0 @@ -class AddIndexOnCiRunnersAccessLevel < ActiveRecord::Migration - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_runners, :access_level - end - - def down - remove_concurrent_index :ci_runners, :access_level if index_exists?(:ci_runners, :access_level) - end -end diff --git a/db/migrate/20170816143940_add_protected_to_ci_pipelines.rb b/db/migrate/20170816143940_add_protected_to_ci_pipelines.rb new file mode 100644 index 00000000000..ce8f1e03686 --- /dev/null +++ b/db/migrate/20170816143940_add_protected_to_ci_pipelines.rb @@ -0,0 +1,7 @@ +class AddProtectedToCiPipelines < ActiveRecord::Migration + DOWNTIME = false + + def change + add_column :ci_pipelines, :protected, :boolean + end +end diff --git a/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb b/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb new file mode 100644 index 00000000000..caf7c705a6e --- /dev/null +++ b/db/migrate/20170816153940_add_index_on_ci_builds_protected.rb @@ -0,0 +1,15 @@ +class AddIndexOnCiBuildsProtected < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_builds, :protected + end + + def down + remove_concurrent_index :ci_builds, :protected if index_exists?(:ci_builds, :protected) + end +end diff --git a/db/schema.rb b/db/schema.rb index c933b47ab01..c41c9e98a4f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170824162758) do +ActiveRecord::Schema.define(version: 20170830125940) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -255,6 +255,7 @@ ActiveRecord::Schema.define(version: 20170824162758) do add_index "ci_builds", ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref", using: :btree add_index "ci_builds", ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref", using: :btree add_index "ci_builds", ["project_id"], name: "index_ci_builds_on_project_id", using: :btree + add_index "ci_builds", ["protected"], name: "index_ci_builds_on_protected", using: :btree add_index "ci_builds", ["runner_id"], name: "index_ci_builds_on_runner_id", using: :btree add_index "ci_builds", ["stage_id"], name: "index_ci_builds_on_stage_id", using: :btree add_index "ci_builds", ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id", using: :btree @@ -337,6 +338,7 @@ ActiveRecord::Schema.define(version: 20170824162758) do t.integer "auto_canceled_by_id" t.integer "pipeline_schedule_id" t.integer "source" + t.boolean "protected" end add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree @@ -375,7 +377,6 @@ ActiveRecord::Schema.define(version: 20170824162758) do t.integer "access_level", default: 0, null: false end - add_index "ci_runners", ["access_level"], name: "index_ci_runners_on_access_level", using: :btree add_index "ci_runners", ["contacted_at"], name: "index_ci_runners_on_contacted_at", using: :btree add_index "ci_runners", ["is_shared"], name: "index_ci_runners_on_is_shared", using: :btree add_index "ci_runners", ["locked"], name: "index_ci_runners_on_locked", using: :btree |