From 90eea6b909a670abeb72c209040cba6c6d55958d Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 15 May 2024 10:21:41 +0200 Subject: [PATCH] adapt database test for wikipedia importance to new tables --- nominatim/tools/check_database.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nominatim/tools/check_database.py b/nominatim/tools/check_database.py index 8ffd93fe4..288eb916d 100644 --- a/nominatim/tools/check_database.py +++ b/nominatim/tools/check_database.py @@ -248,7 +248,10 @@ def check_existance_wikipedia(conn: Connection, _: Configuration) -> CheckResult return CheckState.NOT_APPLICABLE with conn.cursor() as cur: - cnt = cur.scalar('SELECT count(*) FROM wikipedia_article') + if conn.table_exists('wikimedia_importance'): + cnt = cur.scalar('SELECT count(*) FROM wikimedia_importance') + else: + cnt = cur.scalar('SELECT count(*) FROM wikipedia_article') return CheckState.WARN if cnt == 0 else CheckState.OK