From f70473dc0b585cf4fb4a060c9df0b183d52bf875 Mon Sep 17 00:00:00 2001 From: Jim Ladd Date: Mon, 8 Feb 2021 22:26:23 -0800 Subject: [PATCH] When copying main_jobevent, include all table metadata * copy the table just like we do in the bigint migration * without this we lose sequences and very likely other things as well * we want the new table to be identical to the old table, so 'including all' makes sense --- awx/main/migrations/0124_event_partitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/migrations/0124_event_partitions.py b/awx/main/migrations/0124_event_partitions.py index ebd36e4199..554d9cb6b3 100644 --- a/awx/main/migrations/0124_event_partitions.py +++ b/awx/main/migrations/0124_event_partitions.py @@ -40,7 +40,7 @@ def migrate_event_data(apps, schema_editor): # hacky creation of parent table for partition cursor.execute( f'CREATE TABLE {tblname} ' - f'(LIKE {tblname}_old, job_created TIMESTAMP WITH TIME ZONE NOT NULL) ' + f'(LIKE {tblname}_old INCLUDING ALL, job_created TIMESTAMP WITH TIME ZONE NOT NULL) ' f'PARTITION BY RANGE(job_created);' )