From 88ba7374d7762a1f87f1a21ef0f94157ae322328 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 16 Sep 2019 19:56:47 +0200 Subject: [PATCH] [MIG] base_location: Cover case of res_better_zip w/o country_id --- base_location/migrations/12.0.1.0.0/post-migration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_location/migrations/12.0.1.0.0/post-migration.py b/base_location/migrations/12.0.1.0.0/post-migration.py index 093fb0564..a022f47fd 100644 --- a/base_location/migrations/12.0.1.0.0/post-migration.py +++ b/base_location/migrations/12.0.1.0.0/post-migration.py @@ -22,8 +22,9 @@ def migrate(env, version): SELECT city, state_id, country_id, MIN(create_uid), MIN(create_date), MIN(write_uid), MIN(write_date) - FROM res_better_zip + FROM res_better_zip rbz WHERE city_id IS NULL + AND rbz.country_id IS NOT NULL GROUP BY city, state_id, country_id ON CONFLICT DO NOTHING""", )