mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 09:57:35 -02:30
Create partition only if it doesn't exist
This commit is contained in:
@@ -1047,7 +1047,7 @@ def create_partition(start, end=None, partition_label=None):
|
|||||||
#):
|
#):
|
||||||
for tblname in ('main_jobevent',):
|
for tblname in ('main_jobevent',):
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
f'CREATE TABLE {tblname}_{partition_label} '
|
f'CREATE TABLE IF NOT EXISTS {tblname}_{partition_label} '
|
||||||
f'PARTITION OF {tblname} '
|
f'PARTITION OF {tblname} '
|
||||||
f'FOR VALUES FROM (\'{start_timestamp}\') to (\'{end_timestamp}\');'
|
f'FOR VALUES FROM (\'{start_timestamp}\') to (\'{end_timestamp}\');'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user