Flowdock
method

execute_migration_in_transaction

Importance_0
v5.1.7 - Show latest stable - 0 notes - Class: ActiveRecord::Migrator
execute_migration_in_transaction(migration, direction) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/migration.rb, line 1223
      def execute_migration_in_transaction(migration, direction)
        return if down? && !migrated.include?(migration.version.to_i)
        return if up?   &&  migrated.include?(migration.version.to_i)

        Base.logger.info "Migrating to #{migration.name} (#{migration.version})" if Base.logger

        ddl_transaction(migration) do
          migration.migrate(direction)
          record_version_state_after_migrating(migration.version)
        end
      rescue => e
        msg = "An error has occurred, "
        msg << "this and " if use_transaction?(migration)
        msg << "all later migrations canceled:\n\n#{e}"
        raise StandardError, msg, e.backtrace
      end
Register or log in to add new notes.