From 860760120843ea5ad003cc2f52b28cf0fc7c647b Mon Sep 17 00:00:00 2001
From: Grzegorz Bizon <grzesiek.bizon@gmail.com>
Date: Mon, 9 May 2016 11:18:47 +0200
Subject: [PATCH] Add config field to runner to lock it on project

---
 db/migrate/20160509091049_add_locked_to_ci_runner.rb | 8 ++++++++
 db/schema.rb                                         | 1 +
 2 files changed, 9 insertions(+)
 create mode 100644 db/migrate/20160509091049_add_locked_to_ci_runner.rb

diff --git a/db/migrate/20160509091049_add_locked_to_ci_runner.rb b/db/migrate/20160509091049_add_locked_to_ci_runner.rb
new file mode 100644
index 00000000000..6294fa9d86b
--- /dev/null
+++ b/db/migrate/20160509091049_add_locked_to_ci_runner.rb
@@ -0,0 +1,8 @@
+class AddLockedToCiRunner < ActiveRecord::Migration
+  ##
+  # Downtime expected due to exclusive lock when setting default value.
+  #
+  def change
+    add_column :ci_runners, :locked, :boolean, default: false, null: false
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b7adf48fdb4..6e60c39fc22 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -285,6 +285,7 @@ ActiveRecord::Schema.define(version: 20160608155312) do
     t.string   "platform"
     t.string   "architecture"
     t.boolean  "run_untagged", default: true,  null: false
+    t.boolean  "locked",       default: false, null: false
   end
 
   add_index "ci_runners", ["description"], name: "index_ci_runners_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"}
-- 
GitLab