Skip to content

Instantly share code, notes, and snippets.

@nomsolence
Last active January 27, 2020 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nomsolence/69bc0b5fe1ba943d82cd37fdbd23df6d to your computer and use it in GitHub Desktop.
Save nomsolence/69bc0b5fe1ba943d82cd37fdbd23df6d to your computer and use it in GitHub Desktop.
# 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