Skip to content

Instantly share code, notes, and snippets.

@nomsolence nomsolence/db.png Secret
Last active Jan 27, 2020

Embed
What would you like to do?
# syrup schema file
# Dress Garden
# a cute database for Say Yes to the Dress videos
!dialect:sqlite
YoutubeVideo (
v :: text ^primary # Youtube ID
watched :: bool = false
tagged :: bool = false
title :: text
uploaded_at :: time
downloaded_at :: time
Channel -> YoutubeChannel.id
Episode? -> Episode.id
)
Episode (
@id
name? :: text *unique
desc? :: text
# one-to-one EpisodeBudget
# many-to-one EpisodeTag{,Assoc}
Store? -> Store.id
# many-to-one Consultant ConsultantAppearance
)
EpisodeTag (
name :: text ^primary
desc? :: text
)
EpisodeTagAssoc (
Episode -> Episode.id
Tag -> EpisodeTag.name
*unique Episode Tag
)
EpisodeBudget (
Episode -> Episode.id ^primary
Currency -> Currency.id
amount :: int
)
ConsultantAppearance (
Episode -> Episode.id
Consultant -> Consultant.id
*unique Episode Consultant
)
Store (
@id
name :: text *unique
desc? :: text
country? :: text
)
Consultant (
@id
name :: text *unique
desc? :: text
awful? :: bool
Store -> Store.id # their normal store
Designer? -> Designer.id # some consultants also design dresses
)
Dress (
@id
number? :: int # which dress in the episode
rating? :: int
thoughts? :: text
Episode -> Episode.id
Designer? -> Designer.id
# many-to-one DressTag{,Assoc}
)
DressTag (
name :: text ^primary
desc? :: text
type? :: text # meta-tag, e.g. Style
)
DressTagAssoc (
Dress -> Dress.id
Tag -> DressTag.name
*unique Dress Tag
)
Designer (
@id
name :: text *unique
desc? :: text
thoughts? :: text
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.