Drop foreign key constraint to Store table

Offen
#168 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@bjester arbeitet bereits daran.

Seit 07.6.2022.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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+
Vorherrschende Sprache
Python
Sterne
15
Forks
27
Ø Merge
6 T. 44 Min.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus learningequality/morango

Alle Issues in learningequality/morango

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.