Repository navigation
Conversation
20.0 gives a service a span instead of a point: date is dropped, date_from and date_to added. date_from carries 19.0's date help text unchanged -- "Date when the cost has been executed" -- and the same default of today. That default is what makes the loss invisible. The column is created full, not empty, so nothing looks wrong: all six of the seed's service logs came out on the day the upgrade ran, having held six different dates. A vehicle's whole service history moves to today. After the rename: 6 distinct dates, none of them today. Assisted-by: Claude Opus 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pre-migration.py
A service log's
datebecomesdate_from, and nothing says so.20.0 gives a service record a span instead of a point:
dateis dropped,date_fromanddate_toare added, and a CHECK enforces the order::The analysis reports a DEL and two NEWs, which reads as three unrelated
changes. The field definitions say otherwise -- 20.0's
date_fromcarries19.0's
datehelp text unchanged, "Date when the cost has beenexecuted", and the same
default=fields.Date.context_today:and 20.0's own
_get_odometer-adjacent code passesdate_fromwherever itneeds the service's date.
Because
date_fromcarries that default, nothing about the upgrade lookswrong without this: the column is created, every existing row is filled with
the day the upgrade ran, and every service in the vehicle's history
silently moves to today. The seed's six service logs hold six different
dates; all six come out identical.
Renaming in pre-migration carries the values and leaves
date_tonull,which the CHECK allows.
tests
openupgrade_scripts/scripts/fleet/tests/test_fleet_migration.pyCI: red until #118 lands
The
testjob fails onduplicate key value violates unique constraint "res_country_state_name_code_uniq"(Ladakh / Odisha). Not this branch:base's pre-migration, which renames those two external ids, lives in #118 andis not on
20.0yet, so every branch cut from20.0alone hits it. Per thefork's model the per-PR check is the lean one; the real migration gate is the
integration branch (#120), where all of this runs green over the full
585-module seed.
AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.