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. Evaluation tables retain historical records; new answers are not scored.

Video search data​

Resumable processing​

Each video has at most one current plan of each kind. Deleting a video removes its plans and chunks by foreign-key cascade.

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.