[19.0][FIX] openupgrade_framework: survive fresh databases - #5954
Open
MiquelRForgeFlow wants to merge 2 commits into
Open
[19.0][FIX] openupgrade_framework: survive fresh databases#5954MiquelRForgeFlow wants to merge 2 commits into
MiquelRForgeFlow wants to merge 2 commits into
Conversation
…ases The ir_model_fields#translate cleanup ran unconditionally in _update_from_database, but on a brand new database that table does not exist yet: base_data.sql does not create it, the ORM does later on while loading base. Initializing a database with openupgrade_framework loaded aborted the transaction with 'relation "ir_model_fields" does not exist'.
…h installs The load_module_graph patch forces the upgrade scripts of every module in the graph, which also brought in the module's own migrations/ and upgrades/ scripts for modules being installed from scratch. There installed_version is empty, so every version folder compares as pending and all the historical
Contributor
|
Hi @StefanRijnhart, @legalsylvain, @hbrunn, |
hbrunn
requested changes
Sep 1, 2026
hbrunn
left a comment
Member
There was a problem hiding this comment.
why do you load openupgrade_framework during database installation in the first place?
| for pkg in self.graph: | ||
| if pkg.load_state != "to upgrade" and pkg.name in self.migrations: | ||
| self.migrations[pkg.name]["module"] = {} | ||
| self.migrations[pkg.name]["module_upgrades"] = {} |
Member
There was a problem hiding this comment.
won't this break running migration script for newly installed dependencies?
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.
The
ir_model_fields#translatecleanup ran before the table exists: on a brand new databasebase_data.sqldoes not create it, the ORM does later on. Guard it withtable_exists().Forcing the upgrade scripts of every module in the graph also ran the module's own historical migration scripts for modules installed from scratch, where
installed_versionis empty and thus every version folder matches. Installingl10n_ch,l10n_in,l10n_nl,l10n_plorl10n_sgfailed on their 9.0 scripts, which import a function removed fromaccountlong ago. Keep only the OpenUpgrade scripts fromupgrade_pathfor those modules.Found doing manual analysis from fresh database for #5953.