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
path: root/lib
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-05-16 01:06:52 +0300
committerkushalpandya <kushal@gitlab.com>2017-05-22 11:25:38 +0300
commit2f097402599dc8c734759e1bef3ec2c4534f594d (patch)
tree0f880d2c744d16d5447fc52e41b855c4f244bf15 /lib
parentadd9abadbdfac7e4c03b06b47d3afc296e00ac97 (diff)
[ci skip] Conflicts while picking !11396 into 9-2-stable
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/database/migration_helpers.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb
index 298b1a1f4e6..73d2bc2a66c 100644
--- a/lib/gitlab/database/migration_helpers.rb
+++ b/lib/gitlab/database/migration_helpers.rb
@@ -278,6 +278,22 @@ module Gitlab
raise 'rename_column_concurrently can not be run inside a transaction'
end
+<<<<<<< HEAD
+=======
+ old_col = column_for(table, old)
+ new_type = type || old_col.type
+
+ add_column(table, new, new_type,
+ limit: old_col.limit,
+ precision: old_col.precision,
+ scale: old_col.scale)
+
+ # We set the default value _after_ adding the column so we don't end up
+ # updating any existing data with the default value. This isn't
+ # necessary since we copy over old values further down.
+ change_column_default(table, new, old_col.default) if old_col.default
+
+>>>>>>> c53d06c4d8... Merge branch 'dm-rename-column-concurrently-with-null' into 'master'
trigger_name = rename_trigger_name(table, old, new)
quoted_table = quote_table_name(table)
quoted_old = quote_column_name(old)
@@ -303,6 +319,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