mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 02:17:37 -02:30
set event horizon to -1 for empty tables
This commit is contained in:
@@ -181,7 +181,7 @@ def unpartitioned_event_horizon(cls):
|
|||||||
with connection.cursor() as cursor:
|
with connection.cursor() as cursor:
|
||||||
try:
|
try:
|
||||||
cursor.execute(f'SELECT MAX(id) FROM _unpartitioned_{cls._meta.db_table}')
|
cursor.execute(f'SELECT MAX(id) FROM _unpartitioned_{cls._meta.db_table}')
|
||||||
return cursor.fetchone()[0]
|
return cursor.fetchone()[0] or -1
|
||||||
except ProgrammingError:
|
except ProgrammingError:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user