Drop foreign key constraint to Store table

Đang mở
#168 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@bjester đang làm issue này rồi.

Từ ngày 7/6/2022.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

DEV: backend

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 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+
Ngôn ngữ chính
Python
Star
15
Fork
27
Merge trung bình
6 ngày 44 phút
Pull request đã merge (30 ngày)
13

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của learningequality/morango

Tất cả issue của learningequality/morango

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.