Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add after_migrate_hook to db:migrate commands #41072

Closed

Conversation

ylecuyer
Copy link
Contributor

@ylecuyer ylecuyer commented Jan 10, 2021

Summary

This is a port of what has been done in https://github.com/adacosta/mongoid_rails_migrations adacosta/mongoid_rails_migrations#54 / adacosta/mongoid_rails_migrations#56 by @JordanThiercelin

Other Information

This change allows to define a ActiveRecord::Migration.after_migrate_hook = -> (log, name, direction, error) { # NOOP }

Which gets called after migrating or reverting (usually with rails db:migrate / rails db:rollback but also works with :up / :down / ...)

A typical use case is to upload the log of the migration to some storage after the migration took place on prod

Base automatically changed from master to main January 14, 2021 17:03
@rails-bot
Copy link

rails-bot bot commented Apr 14, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Apr 14, 2021
# Conflicts:
#	activerecord/CHANGELOG.md
@rails-bot rails-bot bot removed the stale label Apr 15, 2021
@rails-bot
Copy link

rails-bot bot commented Jul 14, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Jul 14, 2021
@rails-bot rails-bot bot closed this Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant