-
Notifications
You must be signed in to change notification settings - Fork 46
Conversation
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.
HI @katdom13 The changes look good to me.
Just to note, there was an error when pushing this to staging earlier. And @nickmoreton has reverted the deployment. The error occured when trying to run The error is something like
It is related to the this line in the migration file for wagtail contrib search promotions. Since we don't use search in this project, we could easily fake the migration ( So I added a commit to remove search promotion altogether, since we are not using it. |
@nickmoreton Can you code review my fix please? See my explanation above. |
I can see that works. Something I learnt recently was you can make the operations an empty list in the migration thats erroring. Would that then avoid having to change the dependent migrations? |
@nickmoreton In this case the operation that is having problem is part of Wagtail core (https://github.com/wagtail/wagtail/blob/main/wagtail/contrib/search_promotions/migrations/0004_copy_queries.py#L18-L19). I don't think we can 'override' migrations in external packages? Somehow no one has reported this issue, and it is fine with other builds, or a clean db. So it may be something we have done to this particular db in the past. So I can't request a change either. |
fd7f597
to
2f800c7
Compare
The migration with the error above is for migrating the table from the Interestingly, our database's Table description
This is what causes the migration to fail, because using The The migrations for the old model in However... The old model in Worth noting that the field order on the model seems to put the In summaryThis issue happens because Wagtail's Presumably, this issue will show up on Wagtail instances that have been running since v0.5, because wagtail/wagtail#497 (which was released in v0.6) has changed the migrations to use Django Migrations instead of South. Wagtail instances that were created on v0.6 or later will not have this issue. The unlikeliness of people maintaining a project that adopted Wagtail from way back before v1.0 up until v5.0 might explain why we have never heard of a similar report. Ideally, Wagtail should update the migration so that the column names are explicitly specified instead of using |
@laymonage Ah I see now. Great investigation. Thanks for explaining! I didn't realise the |
Worth noting that I tried running this with Wagtail 5.1 and I didn't find any issues, at least with the migrations and quick browsing in the admin. Even reverting the |
0573bb9
to
8c8899c
Compare
…re errors with running the wagtailsearchpromotions 0004 migration.
cc974d0
to
f7418e1
Compare
I have rebased this branch on master as it was far behind the latest commits. I'll push to staging again for a test. |
@nickmoreton please upgrade to 5.1 |
Hi @zerolab I'd love to but at this time we've not started on 5.1 We also haven't started to look at package compatibility > 5.0 |
@nickmoreton both wagtail-webstories and wagtail-markdown, with the versions from this PR work with 5.1 My preference is to go with 5.1 as soon as possible. There is no reason not to do so on projects that do not have hard dependencies on packages that are behind. And I do appreciate the work and effort the support team is putting into these. At the end of the day, this is just my preference ;) |
@victoriachan @nickmoreton if everyone's happy with this on staging, let's get it merged and deployed and follow up with a smalle 5.1 upgrade |
Thanks @zerolab . I've added an update to the ticket (https://torchbox.monday.com/boards/1130687432/pulses/1189810899) and double checking with the DM and @katdom13 who is handling this ticket. Hopefully can get it out today! |
This upgrades Wagtail to ~5.0
Support Ticket: https://torchbox.monday.com/boards/1130687432/pulses/1189810899
Wagtail 5.0 upgrade considerations: https://docs.wagtail.org/en/stable/releases/5.0.html
Includes Django security release CVE-2023-36053: https://www.djangoproject.com/weblog/2023/jul/03/security-releases/
Notes:
Might need to run the commandNot need now that we've removed search_promotions.copy_daily_hits_from_wagtailsearch
after deploymentrebuild_references_index