mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
db: Add mediums and albums
This commit is contained in:
parent
3eed04d04b
commit
3ab0332475
4 changed files with 152 additions and 7 deletions
|
|
@ -129,7 +129,9 @@ pub struct RecordingEnsemble {
|
|||
pub struct Track {
|
||||
pub track_id: String,
|
||||
pub recording_id: String,
|
||||
pub sequence_number: i32,
|
||||
pub recording_index: i32,
|
||||
pub medium_id: Option<String>,
|
||||
pub medium_index: Option<i32>,
|
||||
pub path: String,
|
||||
pub created_at: NaiveDateTime,
|
||||
pub edited_at: NaiveDateTime,
|
||||
|
|
@ -144,3 +146,41 @@ pub struct TrackWork {
|
|||
pub work_id: String,
|
||||
pub sequence_number: i32,
|
||||
}
|
||||
|
||||
#[derive(Insertable, Queryable, Selectable, Clone, Debug)]
|
||||
#[diesel(check_for_backend(Sqlite))]
|
||||
pub struct Medium {
|
||||
pub medium_id: String,
|
||||
pub discid: String,
|
||||
pub created_at: NaiveDateTime,
|
||||
pub edited_at: NaiveDateTime,
|
||||
pub last_used_at: NaiveDateTime,
|
||||
pub last_played_at: Option<NaiveDateTime>,
|
||||
}
|
||||
|
||||
#[derive(Insertable, Queryable, Selectable, Clone, Debug)]
|
||||
#[diesel(check_for_backend(Sqlite))]
|
||||
pub struct Album {
|
||||
pub album_id: String,
|
||||
pub name: TranslatedString,
|
||||
pub created_at: NaiveDateTime,
|
||||
pub edited_at: NaiveDateTime,
|
||||
pub last_used_at: NaiveDateTime,
|
||||
pub last_played_at: Option<NaiveDateTime>,
|
||||
}
|
||||
|
||||
#[derive(Insertable, Queryable, Selectable, Clone, Debug)]
|
||||
#[diesel(check_for_backend(Sqlite))]
|
||||
pub struct AlbumRecording {
|
||||
pub album_id: String,
|
||||
pub recording_id: String,
|
||||
pub sequence_number: i32,
|
||||
}
|
||||
|
||||
#[derive(Insertable, Queryable, Selectable, Clone, Debug)]
|
||||
#[diesel(check_for_backend(Sqlite))]
|
||||
pub struct AlbumMedium {
|
||||
pub album_id: String,
|
||||
pub medium_id: String,
|
||||
pub sequence_number: i32,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue