Skip to content

Commit

Permalink
adapt database test for wikipedia importance to new tables
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed May 16, 2024
1 parent 5b02cd2 commit 90eea6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nominatim/tools/check_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 90eea6b

Please sign in to comment.