diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2016-12-05 07:16:08 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2016-12-05 07:16:08 +0900 |
commit | 7f0567b43b73b1bd1a16bfac9cd32fcbf1321b51 (patch) | |
tree | 294f8ae04fe61c55315077faf6f4febf7f54e150 /activerecord/lib/active_record/connection_adapters | |
parent | 66076f381aad7383568bf28ae1279b0bc570319c (diff) | |
download | rails-7f0567b43b73b1bd1a16bfac9cd32fcbf1321b51.tar.gz rails-7f0567b43b73b1bd1a16bfac9cd32fcbf1321b51.tar.bz2 rails-7f0567b43b73b1bd1a16bfac9cd32fcbf1321b51.zip |
Fix that `change_column` lose a comment
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 98152853c2..db0ff749c1 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -769,6 +769,10 @@ module ActiveRecord options[:null] = column.null end + unless options.key?(:comment) + options[:comment] = column.comment + end + td = create_table_definition(table_name) cd = td.new_column_definition(column.name, type, options) schema_creation.accept(ChangeColumnDefinition.new(cd, column.name)) |