Add curriculum read models - #8
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds unmanaged Django ORM “read models” for the existing curriculum tables (concept, relation_type, relation) so the API codebase can query the prototype Supabase schema with correct keys, relationships, and semantic identity.
Changes:
- Introduces unmanaged models
Concept,RelationType, andRelationwith PK/FK mappings and explicit reverse relationship names. - Encodes the semantic uniqueness rule for relations via a
UniqueConstrainton(source, type, target). - Adds tests that validate the ORM metadata mapping (PKs, columns, FKs, reverse names, on-delete behavior, constraint name/fields, and
__str__semantics).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| core/models.py | Adds unmanaged Django models mapping to existing curriculum tables with PK/FK relationships and a semantic uniqueness constraint. |
| tests/test_curriculum_models.py | Adds tests asserting the Django model metadata and string representation match the intended DB mapping/semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
concepttable to an unmanaged Django modelrelation_typetable to an unmanaged Django modelrelationtable and its foreign keysDatabase mapping
Concept.slugis the concept primary keyRelationType.slugis the relation-type primary keyRelation.sourcereferencesConcept.slugRelation.typereferencesRelationType.slugRelation.targetreferencesConcept.slugRelation.idremains the technical UUID primary key(source, type, target)remains semantically uniqueVerification
uv run python manage.py checkuv run pytestDatabase assumptions
The Supabase database is currently a prototype.
The schema changes applied during development are not included as repository migrations in this PR. These unmanaged models therefore assume that the connected database already contains the expected tables and constraints.
Database migration history and reproducible database provisioning will be introduced separately when the prototype schema is rebuilt.
Out of scope