fix(migrations): reset failed 0024 migration DEV-2094#7056
Conversation
|
| if lrm_0024.status == 'failed': | ||
| lrm_0024.status = 'created' | ||
| lrm_0024.save() |
There was a problem hiding this comment.
When resetting the migration to
'created', the error field retains the old failure message, so the record will briefly show an error even though it's in a clean "ready to retry" state. Scoping the save to update_fields (as execute() does elsewhere in the model) and clearing error at reset time makes the record's state unambiguous for any tooling or admin page that reads it.
| if lrm_0024.status == 'failed': | |
| lrm_0024.status = 'created' | |
| lrm_0024.save() | |
| if lrm_0024.status == 'failed': | |
| lrm_0024.status = 'created' | |
| lrm_0024.error = None | |
| lrm_0024.save(update_fields=['status', 'error', 'date_modified']) |
There was a problem hiding this comment.
I think we should actually keep the error around so we know that this was a rerun. It might be a little ambiguous but I think it's better than losing that data.
There was a problem hiding this comment.
Agree with you but maybe we can alter the error message with lrm_0024.error = f'previous error: {lrm_0024.error}'.
Not required, just an idea.
There was a problem hiding this comment.
Makes sense to me. Updating
| @@ -0,0 +1,35 @@ | |||
| # Generated by Django 4.2.28 on 2026-05-14 12:47 | |||
There was a problem hiding this comment.
PR description doesn't follow the repository template
The checklist section in the PR description includes the instruction "delete this section before merging" and all items remain unchecked. The 📣 Summary, 📖 Description, and 💭 Notes sections still show TODO or are absent without being explicitly deleted. Per the repository's PR template, the checklist block must be removed before merge, and any inapplicable sections should be explicitly deleted (rather than left as TODO).
Rule Used: What: PR descriptions must follow the repository's... (source)
noliveleger
left a comment
There was a problem hiding this comment.
LGTM
Look at my comment and adapt it if you want.
🗒️ Checklist
#Support Docs Updates, if any<type>(<scope>)<!>: <title> DEV-1234Front endand/orBack endorworkflow👷 Description for instance maintainers
Force servers to rerun migration 0024 if it failed due to the bug addressed in #7051