mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Correctly handle case where unpartitioned table does not exist (#14648)
This commit is contained in:
parent
8c4bff2b86
commit
1f36e84b45
@ -128,6 +128,10 @@ logger = logging.getLogger('awx.api.views')
|
||||
|
||||
|
||||
def unpartitioned_event_horizon(cls):
|
||||
with connection.cursor() as cursor:
|
||||
cursor.execute(f"SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE table_name = '_unpartitioned_{cls._meta.db_table}';")
|
||||
if not cursor.fetchone():
|
||||
return 0
|
||||
with connection.cursor() as cursor:
|
||||
try:
|
||||
cursor.execute(f'SELECT MAX(id) FROM _unpartitioned_{cls._meta.db_table}')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user