Disable Rails migration Transaction wrapper
Rails Migrations are wrapped by a database transaction by default, so if you need to disable it by any reason use disable_ddl_transaction!().
class MyMigration < ActiveRecord::Migration[5.1]
  disable_ddl_transaction!
  def change
    # run some code with no db transaction
  end
endCheck the documentation.
Tweet