-
Notifications
You must be signed in to change notification settings - Fork 53
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
v3: fix the migration mess #1211
base: v3
Are you sure you want to change the base?
Conversation
035aa93
to
236d4c2
Compare
Let's see if I understand. pre-script version N can be executed while the code version N-1 is running. Is the idea that procrastinate semantic versioning is at the programmatic API level and that any new version can possibly introduce database breaking changes as long as there is the ability to split them in pre-scripts and post-scripts to maintain blue-green deployments of the codebase? What are your thoughts about testing out that pre-migration script is backward compatible? I like it. |
Yep. I think this change removes some hurdles that make keeping blue-green possible (and sane) while the current state of affairs made it more confusing than it needed to be and harder to achieve. We can iterate on the tooling to make this actually easy in the future.
My ideas: |
DROP FUNCTION IF EXISTS procrastinate_sync_abort_requested_with_status_v1; | ||
|
||
-- Create a new enum type without 'aborting' | ||
CREATE TYPE procrastinate_job_status_v1 AS ENUM ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must this not be created in pre
? Some functions already use it there.
I think I get the idea now and also like it 🙂. The separation between |
I'm delighted by your answers. You're most probably right that we'll need to continue adjusting a few things. Given that we need v3+pre to work, we need v3's queries to work with pre, which means the new enum needs to be supported in pre. Post can only be used to clean the mess. |
Closes #1189
Warning
the word "mess" is is solely directed at the mess I created trhough unclear rules and overly complex processes, the work done so far by everyone has been amazing
Introduce a new migration process: pre-migrations and post-migrations.
So the idea is that:
(I'm 80% sure that I have missed a few corner cases)
Is it going in the right direction according to you @medihack @onlyann ?
Successful PR Checklist:
PR label(s):