diff --git a/addons/cetmix_tower_yaml/migrations/16.0.1.4.1/post-migration.py b/addons/cetmix_tower_yaml/migrations/16.0.1.4.1/post-migration.py new file mode 100644 index 0000000..8238759 --- /dev/null +++ b/addons/cetmix_tower_yaml/migrations/16.0.1.4.1/post-migration.py @@ -0,0 +1,19 @@ +def migrate(cr, version): + """ + Normalize existing license values to lowercase. + Runs only on upgrade (version != False). + """ + if not version: + return + # Skip rows already lowercase for efficiency + cr.execute( + """ + UPDATE cx_tower_yaml_manifest_tmpl + SET license = LOWER(TRIM(license)) + WHERE license IS NOT NULL + AND ( + license <> LOWER(license) + OR license <> TRIM(license) + ) + """ + )