summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-06-06 18:20:30 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-06-09 16:00:24 +0800
commit2ea0148c55fbefee1137c254a94b37c05dca41cf (patch)
tree6b714c1a4bf3ad9fe3f6e9c4d711c9d6659e3ccb /db
parent35954572b898e5a58cd209276e1bff499990867b (diff)
downloadgitlab-ce-2ea0148c55fbefee1137c254a94b37c05dca41cf.tar.gz
Update migration with add_column_with_default:
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4093#note_12278454
Diffstat (limited to 'db')
-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