bin/ridgepole in ridgepole-0.5.3.beta4 vs bin/ridgepole in ridgepole-0.6.0.beta
- old
+ new
@@ -64,13 +64,17 @@
opt.on('', '--table-options OPTIONS') {|v| options[:table_options] = v }
opt.on('', '--bulk-change') {
raise "Cannot use `bulk-change` in `merge`" if options[:merge]
options[:bulk_change] = true
}
- opt.on('', '--default-int-limit LIMIT', Integer) {|v|
- options[:default_int_limit] = v
- }
+
+ Ridgepole::DEFAULTS_LIMITS.keys.each do |column_type|
+ opt.on('', "--default-#{column_type == :integer ? :int : column_type}-limit LIMIT", Integer) {|v|
+ options[:"default_#{column_type}_limit"] = v
+ }
+ end
+
opt.on('', '--pre-query QUERY') {|v| options[:pre_query] = v }
opt.on('', '--post-query QUERY') {|v| options[:post_query] = v }
opt.on('-e', '--export') { set_mode[:export] }
opt.on('', '--split') {|v| split = true }
opt.on('', '--split-with-dir') {|v| split = :with_dir }
@@ -89,17 +93,12 @@
opt.on('', '--reverse') { options[:reverse] = true }
opt.on('', '--with-apply') { diff_with_apply = true }
opt.on('-o', '--output FILE') {|v| output_file = v }
opt.on('-t', '--tables TABLES', Array) {|v| options[:tables] = v }
opt.on('', '--ignore-tables TABLES', Array) {|v| options[:ignore_tables] = v.map {|i| Regexp.new(i) } }
- opt.on('', '--enable-mysql-unsigned') { options[:enable_mysql_unsigned] = true }
- opt.on('', '--enable-mysql-pkdump') { options[:enable_mysql_pkdump] = true }
- opt.on('', '--enable-foreigner') { options[:enable_foreigner] = true }
- opt.on('', '--enable-migration-comments') { options[:enable_migration_comments] = true }
opt.on('', '--enable-mysql-awesome') { options[:enable_mysql_awesome] = true }
opt.on('', '--mysql-awesome-unsigned-pk') { options[:mysql_awesome_unsigned_pk] = true }
- opt.on('', '--normalize-mysql-float') { options[:normalize_mysql_float] = true }
opt.on('', '--dump-without-table-options') { options[:dump_without_table_options] = true }
opt.on('-r' , '--require LIBS', Array) {|v| v.each {|i| require i } }
opt.on('' , '--log-file LOG_FILE') {|v| options[:log_file] = v }
opt.on('' , '--verbose') { Ridgepole::Logger.verbose = true }
opt.on('' , '--debug') { options[:debug] = true }
@@ -113,21 +112,12 @@
if not mode or ([:apply, :export].include?(mode) and not config) or (options[:with_apply] and not config)
puts opt.help
exit 1
end
-
- if options[:enable_mysql_awesome]
- if options[:enable_migration_comments]
- raise "It is not possible to enable both `--enable-mysql-awesome` and `--enable-migration-comments`"
- elsif options[:enable_mysql_unsigned]
- raise "It is not possible to enable both `--enable-mysql-awesome` and `--enable-mysql-unsigned`"
- elsif options[:enable_mysql_pkdump]
- raise "It is not possible to enable both `--enable-mysql-awesome` and `--enable-mysql-pkdump`"
- end
- end
rescue => e
$stderr.puts("[ERROR] #{e.message}")
+ puts e.backtrace
exit 1
end
end
begin