summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-07-31 23:25:11 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-03 23:49:10 +0900
commite5fd565c74b95815806d139f30676a895b88e29f (patch)
tree509e871ef3c2eec01a69444750ee636e1317568b /db
parente9924687147b1222fa2df3765a1e3c37662028a2 (diff)
downloadgitlab-ce-e5fd565c74b95815806d139f30676a895b88e29f.tar.gz
Solution 1. Persists protected(ref) flag on ci_pipelines table. builds_for_shared_runner and builds_for_specific_runner read the flag instead of executing protected_for? one by one.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170731132235_add_protected_to_ci_pipelines.rb15
-rw-r--r--db/schema.rb1
2 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20170731132235_add_protected_to_ci_pipelines.rb b/db/migrate/20170731132235_add_protected_to_ci_pipelines.rb
new file mode 100644
index 00000000000..bc034f99609
--- /dev/null
+++ b/db/migrate/20170731132235_add_protected_to_ci_pipelines.rb
@@ -0,0 +1,15 @@
+class AddProtectedToCiPipelines < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_column_with_default(:ci_pipelines, :protected, :boolean, default: false)
+ end
+
+ def down
+ remove_column(:ci_pipelines, :protected)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index be12fc07e81..df5755ff888 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -336,6 +336,7 @@ ActiveRecord::Schema.define(version: 20170824162758) do
t.integer "auto_canceled_by_id"
t.integer "pipeline_schedule_id"
t.integer "source"
+ t.boolean "protected", default: false, null: false
end
add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree