From 0574baf7f7dbd22b79537c29ef163f6c3ab85a64 Mon Sep 17 00:00:00 2001 From: Jim Ladd Date: Mon, 8 Feb 2021 22:29:30 -0800 Subject: [PATCH] Create fake partition * Just to get things working * Will implement dynamic creation of partitions later --- awx/main/migrations/0124_event_partitions.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awx/main/migrations/0124_event_partitions.py b/awx/main/migrations/0124_event_partitions.py index 554d9cb6b3..3ca20730fb 100644 --- a/awx/main/migrations/0124_event_partitions.py +++ b/awx/main/migrations/0124_event_partitions.py @@ -50,6 +50,12 @@ def migrate_event_data(apps, schema_editor): f'PARTITION OF {tblname} ' f'FOR VALUES FROM (\'2000-01-01 00:00:00.000000+00\') to (\'2021-02-01 00:00:00.000000+00\');' ) + # .. as well as a tmp partition for all future events (just for testing) + cursor.execute( + f'CREATE TABLE {tblname}_part1 ' + f'PARTITION OF {tblname} ' + f'FOR VALUES FROM (\'2021-02-01 00:00:00.000000+00\') to (\'2022-01-01 00:00:00.000000+00\');' + ) # copy over all job events into partitioned table cursor.execute(