just_ERD
Tables (6)
contents
- id — INT — Primary key — NOT NULL
- title — VARCHAR(500) — NOT NULL
- producer_id — INT — Foreign key → producers.id — NOT NULL
- provider_id — INT — Foreign key → providers.id — NOT NULL
- release_date — DATE
- duration_seconds — INT
producers
- id — INT — Primary key — NOT NULL
- name — VARCHAR(200) — NOT NULL
providers
- id — INT — Primary key — NOT NULL
- name — VARCHAR(200) — NOT NULL
user_subscriptions
- user_id — INT — Foreign key → users.id — NOT NULL
- provider_id — INT — Foreign key → providers.id — NOT NULL
- plan — VARCHAR(100)
- started_at — TIMESTAMP
- ended_at — TIMESTAMP
- status — VARCHAR(50)
users
- id — INT — Primary key — NOT NULL
- username — VARCHAR(100) — NOT NULL
- email — VARCHAR(254) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
watch_history
- id — BIGINT — Primary key — NOT NULL
- user_id — INT — Foreign key → users.id — NOT NULL
- content_id — INT — Foreign key → contents.id — NOT NULL