You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some models with after_commit callbacks around ActiveStorage and some other external interactions that appear to be running after the data migration has completed. In the case of the ActiveStorage attachments they get cut off and raise exceptions. We don't get this behavior if we run the same code from a rake task or in the console.
We're on rails 6.1.4.1 and the latest pub release of the data-migrate gem.
👉 bin/rails data:migrate
== 20220602165945 AddGifCreditProducts: migrating =============================
successfully added gif credits for Denver
successfully added gif credits for Seattle
successfully added gif credits for Minneapolis
successfully added gif credits for Austin
successfully added gif credits for Digital Fulfillment Studio
successfully added gif credits for Los Angeles
== 20220602165945 AddGifCreditProducts: migrated (0.3966s) ====================
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
closed stream
/path-to-rails-app/bin/rails:9:in `<top (required)>'
/path-to-rails-app/bin/spring:15:in `<top (required)>'
Caused by:
IOError: closed stream
/path-to-rails-app/bin/rails:9:in `<top (required)>'
/path-to-rails-app/bin/spring:15:in `<top (required)>'
Tasks: TOP => data:migrate
(See full trace by running task with --trace)
The text was updated successfully, but these errors were encountered:
adding disable_ddl_transaction! to the migration runs each commit and it's callbacks inside the transaction and was good enough for us, even if we miss the all-or-nothing nature of a wrapping transaction.
We have some models with after_commit callbacks around ActiveStorage and some other external interactions that appear to be running after the data migration has completed. In the case of the ActiveStorage attachments they get cut off and raise exceptions. We don't get this behavior if we run the same code from a rake task or in the console.
We're on rails 6.1.4.1 and the latest pub release of the data-migrate gem.
The text was updated successfully, but these errors were encountered: