lib/strong_migrations/migration.rb in strong_migrations-0.1.7 vs lib/strong_migrations/migration.rb in strong_migrations-0.1.8

- old
+ new

@@ -41,18 +41,20 @@ raise_error :add_column_default if options && !options[:default].nil? raise_error :add_column_json if type.to_s == "json" when :change_column raise_error :change_column when :create_table - options = args[1] + options = args[1] || {} raise_error :create_table if options[:force] when :add_reference options = args[2] || {} index_value = options.fetch(:index, ActiveRecord::VERSION::MAJOR >= 5 ? true : false) if postgresql? && index_value raise_error :add_reference end + when :execute + raise_error :execute end end if method == :create_table (@new_tables ||= []) << args[0].to_s @@ -152,14 +154,18 @@ If you're sure this is what you want, wrap it in a safety_assured { ... } block." when :change_table "The strong_migrations gem does not support inspecting what happens inside a change_table block, so cannot help you here. Please make really sure that what -you're doing is safe before proceding, then wrap it in a safety_assured { ... } block." +you're doing is safe before proceeding, then wrap it in a safety_assured { ... } block." when :create_table "The force option will destroy existing tables. If this is intended, drop the existing table first. Otherwise, remove the option." + when :execute +"The strong_migrations gem does not support inspecting what happens inside an +execute call, so cannot help you here. Please make really sure that what +you're doing is safe before proceeding, then wrap it in a safety_assured { ... } block." end wait_message = ' __ __ _____ _______ _ \ \ / /\ |_ _|__ __| |