-
Notifications
You must be signed in to change notification settings - Fork 65
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
Allow r-scripts (run all the time) #27
Comments
Hi, I have some questions!
So how does this work? Is it some SQL which gets run after (or before?) every migration? What happens in the following scenario:
It seems to me that on prod, we would see the following series of events (assuming the r-script runs after each migration):
However, if we start up a new environment, we would see:
This is different, which is a problem. |
Not the OP, so I can't answer the other questions, but with "Fly" he probably means Flyway, the migration framework used by Martin Fowler. |
I think @ottovw might be referring to Flyway's repeatable migrations. These are useful for DDL that doesn't change any existing data by itself (e.g. functions and views). |
Interesting, thanks. Using it to do e.g. |
I'm currently looking for this exact feature too - in our case I'd like to just have some idempotent sql that runs after every migrate run; this way we can just edit it in place rather than duplicating and then editing in a new migration. One of the great things about plain sql migrations is that they can just be concated together to quickly build a db for testing, so ideally this feature would maintain that via a naming scheme that places the post-migrate script logically at the end. I'm not sure exactly how that should look though - perhaps it's just any file with a non-numeric prefix?
@ThomWright I'd love to help out with the implementation of this, if you are happy with the approach. Let me know. |
Fly supports so called r-scripts. They are executed on every migration. I believe that be quite useful.
Thanks
The text was updated successfully, but these errors were encountered: