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
This commit is contained in:
Jim Ladd 2021-02-08 22:26:23 -08:00
parent de0b25862b
commit f70473dc0b

View File

@ -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);'
)