bin/ridgepole in ridgepole-0.8.13 vs bin/ridgepole in ridgepole-0.9.0.beta
- old
+ new
@@ -84,10 +84,23 @@
options[:merge] = true
end
opt.on('-f', '--file SCHEMAFILE') { |v| file = v }
opt.on('', '--dry-run') { options[:dry_run] = true }
opt.on('', '--table-options OPTIONS') { |v| options[:table_options] = v }
+ opt.on('', '--table-hash-options OPTIONS') do |v|
+ # NOTE: Ruby2.4 doesn't support `symbolize_names: true`
+ hash = YAML.safe_load(v).deep_symbolize_keys
+
+ case hash[:id]
+ when String
+ hash[:id] = hash[:id].to_sym
+ when Hash
+ hash[:id][:type] = hash[:id][:type].to_sym if hash[:id][:type]
+ end
+
+ options[:table_hash_options] = hash
+ end
opt.on('', '--alter-extra ALTER_SPEC') { |v| options[:alter_extra] = v }
opt.on('', '--external-script SCRIPT') { |v| options[:external_script] = v }
opt.on('', '--bulk-change') do
raise OptionParser::InvalidOption, 'Cannot use `bulk-change` in `merge`' if options[:merge]
@@ -119,10 +132,9 @@
end
opt.on('', '--with-apply') { diff_with_apply = true }
opt.on('-o', '--output SCHEMAFILE') { |v| output_file = v }
opt.on('-t', '--tables TABLES', Array) { |v| options[:tables] = v }
opt.on('', '--ignore-tables REGEX_LIST', Array) { |v| options[:ignore_tables] = v.map { |i| Regexp.new(i) } }
- opt.on('', '--mysql-use-alter') { options[:mysql_use_alter] = true }
opt.on('', '--dump-without-table-options') { options[:dump_without_table_options] = true }
opt.on('', '--dump-with-default-fk-name') { options[:dump_with_default_fk_name] = true }
opt.on('', '--index-removed-drop-column') { options[:index_removed_drop_column] = true }
opt.on('', '--skip-drop-table') { options[:skip_drop_table] = true }
opt.on('', '--mysql-change-table-options') { options[:mysql_change_table_options] = true }