Add 'media'

Anna Schumaker 2023-03-22 09:49:01 -04:00
parent fd9e98d31a
commit 80ad3a3b96
1 changed files with 28 additions and 0 deletions

28
media.md Normal file

@ -0,0 +1,28 @@
The `media` table holds information for medium playlists. The `media_view` joins the `media` table with the [[playlist_properties]] table so the application can use one query to access all the relevant state for each medium.
### Columns
| Name | Type | Description |
| --------------------------------- | --------------------- | ----------------------------------------------- |
| mediumid | INTEGER | The unique id of a singe medium |
| [propertyid](playlist_properties) | INTEGER | The rowid of this medium's properties |
| [albumid](albums) | INTEGER | The albumid of this medium's album |
| number | INTEGER | The number of this medium in the album |
| name | TEXT | The name of this medium ("Disc 1: Some Name") |
| type | TEXT | The type of this medium ("CD", "Digital Media") |
### Triggers
| Name | When | Description |
| -------------------- | ------------ | --------------------------------------------------------------- |
| media_insert_trigger | After insert | Create a new row in the [[playlist_properties]] table |
| media_delete_trigger | After delete | Delete this medium's entry in the [[playlist_properties]] table |
### The `media_view`
| Column | Description |
| --------------------------------- | -------------------------------------------------------- |
| mediumid | The mediumid of this medium |
| [propertyid](playlist_properties) | The rowid of the [[playlist_properties]] for this medium |
| [albumid](albums) | The albumid of this medium |
| number | The number of this medium |
| name | The name of this medium |
| type | The type of this medium |
| [active](playlist_properties) | The active state of this medium |