lib/ridgepole/diff.rb in ridgepole-0.7.2 vs lib/ridgepole/diff.rb in ridgepole-0.7.3.beta
- old
+ new
@@ -1,7 +1,7 @@
class Ridgepole::Diff
- PRIMARY_KEY_OPTIONS = %i(id limit default null precision scale collation unsigned comment).freeze
+ PRIMARY_KEY_OPTIONS = %i(id limit default null precision scale collation unsigned).freeze
def initialize(options = {})
@options = options
@logger = Ridgepole::Logger.instance
end
@@ -115,13 +115,21 @@
if table_attrs.has_key?(:default) and table_attrs[:default].nil?
table_attrs.delete(:default)
end
end
- if @options[:mysql_change_table_options] and from_options != to_options and Ridgepole::ConnectionAdapters.mysql?
- from.delete(:options)
- to.delete(:options)
- table_delta[:table_options] = to_options
+ if Ridgepole::ConnectionAdapters.mysql?
+ if @options[:mysql_change_table_options] and from_options != to_options
+ from.delete(:options)
+ to.delete(:options)
+ table_delta[:table_options] = to_options
+ end
+
+ if @options[:mysql_change_table_comment] and from[:comment] != to[:comment]
+ from.delete(:comment)
+ to_comment = to.delete(:comment)
+ table_delta[:table_comment] = to_comment
+ end
end
if @options[:dump_without_table_options]
from.delete(:options)
to.delete(:options)