Create songs table
This commit is contained in:
@ -22,6 +22,26 @@ diesel::table! {
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
song_artists (song_id, artist_id) {
|
||||
song_id -> Int4,
|
||||
artist_id -> Int4,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
songs (id) {
|
||||
id -> Int4,
|
||||
title -> Varchar,
|
||||
album_id -> Nullable<Int4>,
|
||||
track -> Nullable<Int4>,
|
||||
duration -> Int4,
|
||||
release_date -> Nullable<Date>,
|
||||
storage_path -> Varchar,
|
||||
image_path -> Nullable<Varchar>,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
users (id) {
|
||||
id -> Int4,
|
||||
@ -34,10 +54,15 @@ diesel::table! {
|
||||
|
||||
diesel::joinable!(album_artists -> albums (album_id));
|
||||
diesel::joinable!(album_artists -> artists (artist_id));
|
||||
diesel::joinable!(song_artists -> artists (artist_id));
|
||||
diesel::joinable!(song_artists -> songs (song_id));
|
||||
diesel::joinable!(songs -> albums (album_id));
|
||||
|
||||
diesel::allow_tables_to_appear_in_same_query!(
|
||||
album_artists,
|
||||
albums,
|
||||
artists,
|
||||
song_artists,
|
||||
songs,
|
||||
users,
|
||||
);
|
||||
|
Reference in New Issue
Block a user