-
-
Notifications
You must be signed in to change notification settings - Fork 535
[FIX] queue_job : check if queue_job_notify exist in pre-migration script to avoid error when migrating from 10.0 revision #380
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
Conversation
…cript to avoid error when migrating from 10.0 revision
|
If I understand, you encounter a postgresql error complaining that this trigger does not exist when it's being disabled in the pre-script. That trigger is disabled on purpose in the pre-stage to prevent the performance impact on table operations that it has. To force create it in another pre-script seems a bit convulated. Can you make it so that it is checked in |
|
Hi stefan, thanks for your review.
indeed.
I didn't added code, I just moved code from post-migration to pre-migration to be executed in the correct order. (check the diff in the file : queue_job/migrations/12.0.1.0.1/post-migration.py). I mean : in the current implementation : That is not consistent. Don't you think ? |
|
Ah I see that the trigger is disabled and then enabled again in the same script. In that case, it makes sense to ensure that the trigger exists beforehand. However, in https://github.com/OCA/queue/blob/12.0/queue_job/migrations/12.0.2.1.0/pre-migration.py there is another mass operation on the table, so unless you disable the trigger there as well, you might introduce a performance regression. |
…t of 12.0.2.1.0 version
|
Hi stefan. Thank you for taking the time to discuss this topic.
Well,
however, I added an extra commit to handle that case : 6e162a4 Do you think it's OK ? |
|
@legalsylvain true! Thanks for the update. |
pedrobaeza
left a comment
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.
I have been hit by this right now. Merging directly as the bot doesn't give any value in this case.
Hi,
Context
queue_jobmodule from version < 12.0. (in my case 10.0)queue_job_notifyon the tablequeue_job.Rational
12.0.1.0.1/post-migration.pycheck if the trigger exist, and if not, create it. (viapost_init_hookfunction)12.0.2.2.0/pre-migration.pyconsider that the trigger exist and disable it. (and enable it after...)The problem is that all the pre-migration scripts are executed before all the post migration scripts.
So the pre-migration script
12.0.2.2.0is executed before the trigger is created.The problem is present since #333 has been merged. CC : authors and reviewers : @etobella, @StefanRijnhart, @simahawk, @guewen
Solution
Log after the PR