method
run
run()
public
Hide source
# File activerecord/lib/active_record/migration.rb, line 962 def run migration = migrations.detect { |m| m.version == @target_version } raise UnknownMigrationVersionError.new(@target_version) if migration.nil? unless (up? && migrated.include?(migration.version.to_i)) || (down? && !migrated.include?(migration.version.to_i)) begin execute_migration_in_transaction(migration, @direction) rescue => e canceled_msg = use_transaction?(migration) ? ", this migration was canceled" : "" raise StandardError, "An error has occurred#{canceled_msg}:\n\n#{e}", e.backtrace end end end