Skip to main content

Reading the ER diagrams

Use this page to understand table relationships. Start with videos, courses, and scenes to learn what the entities mean.

Symbols

|| means one, o{ means zero or more, and o| means zero or one. For example, USERS ||--o{ VIDEOS means one user can own multiple videos.

The diagrams group key relationships by purpose. They do not list every column or constraint. Follow the data dictionary to schema definitions for column details.

Videos and courses

VIDEO_COURSE_MEMBERS connects courses to videos. Tags connect to videos through VIDEO_TAGS. Unique constraints prevent duplicate relationships.

User participation and authentication

VIDEO_COURSE_MEMBERSHIPS stores people's participation. It is distinct from VIDEO_COURSE_MEMBERS above, which stores videos' course associations. See better-auth.ts for the full authentication schema.

Questions and evaluations

Questions, answers, and citations live in chat logs; quality evaluations are separate records. Evaluation may not be complete when the answer is returned.

Learning data generated from videos

Each edge has a source and target concept. Check foreign keys and deletion constraints to understand what happens when either concept is deleted.

Before changing the schema

modern.ts is the source of truth for business data. Check related-row handling when users or videos are deleted, duplicate-prevention constraints, and query indexes together.

Related: Change the database, Where data is stored.