You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While implementing postgres table partitioning for the morango_store table, an overlooked restriction regarding primary keys on the store table popped up. Except under specific partition strategy circumstances, primary keys cannot be enforced on partitioned tables. For the morango_store table, this would be okay, except for any foreign key references to the PK field.
Since we expect the store PK field values to be unique regardless, we'd like to drop the sole FK constraint to the field.
Deliverables
Update the store_model field on RecordMaxCounter to drop the FK constraint
The uniqueness constraint should remain and a rebuild of it should be avoided
Bonus: it would be great to also add an explicit on_delete=models.CASCADE to all FK fields, since the existing implicit behavior is deprecated in Django 2+
The text was updated successfully, but these errors were encountered:
Background
While implementing postgres table partitioning for the
morango_store
table, an overlooked restriction regarding primary keys on the store table popped up. Except under specific partition strategy circumstances, primary keys cannot be enforced on partitioned tables. For themorango_store
table, this would be okay, except for any foreign key references to the PK field.Since we expect the store PK field values to be unique regardless, we'd like to drop the sole FK constraint to the field.
Deliverables
store_model
field onRecordMaxCounter
to drop the FK constrainton_delete=models.CASCADE
to all FK fields, since the existing implicit behavior is deprecated in Django 2+The text was updated successfully, but these errors were encountered: