It's time to analyze :-)
The Podcast template is a Notion based template for preparing your next podcast episode. How can we transform this template to a database model which supports multiple podcast shows?
List of podcast episodes
Overview of a single episode
Content of a single episode
Solution
Schema
// Let's assume that one user has exactly one Podcast show
Table podcast {
id integer [primary key, not null, unique]
// Podcast host
email char(255) [not null, unique]
// Title of podcast
title char(255) [null]
}
Table episode {
id integer [primary key, not null, unique]
podcast_id integer [not null, ref: > user.id]
title char(255) [not null]
// From the episode overview, thus can be null
number integer [null]
// Some icon for this show; maybe a Font Awesome icon
icon char(255) [null]
has_guest boolean [not null]
is_remote boolean [not null]
call_url char(255) [null]
// This can be null if is has not been recorded yet
recorded_at datetime [null]
// Free text fields
topic text [null]
intention text [null]
research text [null]
about_guest text [null]
call_notes text [null]
}
// "Questions" and "Talking points" appear as list items
enum episode_listable_content_type {
question
talking_point
}
Table episode_listable_content {
id integer [primary key, not null, unique]
episode_id integer [not null, ref: > episode.id]
type episode_listable_content_type [not null]
// Top level list item, e.g. "Ice break!"
content text [not null]
// Markdown, e.g. "We are both from Prague, which beer you like?"
notes text [not null]
// Order of list item
order integer [not null]
// The author probably wants to check a list item
is_checked boolean [not null]
}