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""", )