X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/dc52d0954e65d3ed0d0bdca05ff43d8892f704f3..a7a920a9a5b55bf4290b184f05898a8589c95b40:/nominatim/tools/check_database.py diff --git a/nominatim/tools/check_database.py b/nominatim/tools/check_database.py index 721f2cee..288eb916 100644 --- a/nominatim/tools/check_database.py +++ b/nominatim/tools/check_database.py @@ -127,7 +127,7 @@ def _get_indexes(conn: Connection) -> List[str]: # CHECK FUNCTIONS # -# Functions are exectured in the order they appear here. +# Functions are executed in the order they appear here. @_check(hint="""\ {error} @@ -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