Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-06-06 13:20:30 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-06-09 11:00:24 +0300
commit2ea0148c55fbefee1137c254a94b37c05dca41cf (patch)
tree6b714c1a4bf3ad9fe3f6e9c4d711c9d6659e3ccb /db/migrate/20160509091049_add_locked_to_ci_runner.rb
parent35954572b898e5a58cd209276e1bff499990867b (diff)
Update migration with add_column_with_default:
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4093#note_12278454
Diffstat (limited to 'db/migrate/20160509091049_add_locked_to_ci_runner.rb')
-rw-r--r--db/migrate/20160509091049_add_locked_to_ci_runner.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/db/migrate/20160509091049_add_locked_to_ci_runner.rb b/db/migrate/20160509091049_add_locked_to_ci_runner.rb
index 6294fa9d86b..43376304bd9 100644
--- a/db/migrate/20160509091049_add_locked_to_ci_runner.rb
+++ b/db/migrate/20160509091049_add_locked_to_ci_runner.rb
@@ -2,7 +2,12 @@ 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
+ def up
+ add_column_with_default(:ci_runners, :locked, :boolean,
+ default: false, allow_null: false)
+ end
+
+ def down
+ remove_column(:ci_runners, :locked)
end
end