From d11a8b103a53c083cbced0afdb87194680b17b58 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 30 Nov 2018 16:26:00 +0100 Subject: [PATCH] [FIX] auth_brute_force: Don't error on migrations Migrating from v9 will fail as that version doesn't have the 10.0.1.0.0 data structure --- auth_brute_force/migrations/10.0.2.0.0/pre-migrate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth_brute_force/migrations/10.0.2.0.0/pre-migrate.py b/auth_brute_force/migrations/10.0.2.0.0/pre-migrate.py index 7096cb959..4dde20361 100644 --- a/auth_brute_force/migrations/10.0.2.0.0/pre-migrate.py +++ b/auth_brute_force/migrations/10.0.2.0.0/pre-migrate.py @@ -8,6 +8,10 @@ from psycopg2 import IntegrityError def migrate(cr, version): if not version: return + # Don't act when coming from version 9 + cr.execute("SELECT 1 FROM pg_class WHERE relname = 'res_banned_remote'") + if not cr.fetchone(): + return # Fix typo across DB cr.execute( """ UPDATE res_authentication_attempt