summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-15 16:01:09 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-15 16:01:09 -0500
commitbeec97f6cf5f7357238e6f27e48115d6960f3de4 (patch)
tree0954649468479306dfb5b1ce20abec9e99b57098 /lib
parent84199f19197583da44471a6b7f91694b7f4645df (diff)
downloadgitlab-ce-beec97f6cf5f7357238e6f27e48115d6960f3de4.tar.gz
Disallow NULL on renamed column after default has been set
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/database/migration_helpers.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb
index f3476dadec8..e76c9abbe04 100644
--- a/lib/gitlab/database/migration_helpers.rb
+++ b/lib/gitlab/database/migration_helpers.rb
@@ -283,7 +283,6 @@ module Gitlab
add_column(table, new, new_type,
limit: old_col.limit,
- null: old_col.null,
precision: old_col.precision,
scale: old_col.scale)
@@ -307,6 +306,8 @@ module Gitlab
update_column_in_batches(table, new, Arel::Table.new(table)[old])
+ change_column_null(table, new, false) unless old_col.null
+
copy_indexes(table, old, new)
copy_foreign_keys(table, old, new)
end