🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
fix: only create db entities in first migration if they don't exist
Deluand9eb3e58cdfb
diff --git a/db/migrations/20200130083147_create_schema.go b/db/migrations/20200130083147_create_schema.goindex e162d74c7..953a871f5 100644--- a/db/migrations/20200130083147_create_schema.go+++ b/db/migrations/20200130083147_create_schema.go@@ -14,7 +14,7 @@ func init() {func Up20200130083147(tx *sql.Tx) error {log.Info("Creating DB Schema")_, err := tx.Exec(`-create table album+create table if not exists album(id varchar(255) not nullprimary key,@@ -33,22 +33,22 @@ create table albumupdated_at datetime);-create index album_artist+create index if not exists album_artiston album (artist);-create index album_artist_id+create index if not exists album_artist_idon album (artist_id);-create index album_genre+create index if not exists album_genreon album (genre);-create index album_name+create index if not exists album_nameon album (name);-create index album_year+create index if not exists album_yearon album (year);-create table annotation+create table if not exists annotation(ann_id varchar(255) not nullprimary key,@@ -63,19 +63,19 @@ create table annotationunique (user_id, item_id, item_type));-create index annotation_play_count+create index if not exists annotation_play_counton annotation (play_count);-create index annotation_play_date+create index if not exists annotation_play_dateon annotation (play_date);-create index annotation_rating+create index if not exists annotation_ratingon annotation (rating);-create index annotation_starred+create index if not exists annotation_starredon annotation (starred);-create table artist+create table if not exists artist(id varchar(255) not nullprimary key,@@ -83,10 +83,10 @@ create table artistalbum_count integer default 0 not null);-create index artist_name+create index if not exists artist_nameon artist (name);-create table media_file+create table if not exists media_file(id varchar(255) not nullprimary key,@@ -111,19 +111,19 @@ create table media_fileupdated_at datetime);-create index media_file_album_id+create index if not exists media_file_album_idon media_file (album_id);-create index media_file_genre+create index if not exists media_file_genreon media_file (genre);-create index media_file_path+create index if not exists media_file_pathon media_file (path);-create index media_file_title+create index if not exists media_file_titleon media_file (title);-create table playlist+create table if not exists playlist(id varchar(255) not nullprimary key,@@ -135,17 +135,17 @@ create table playlisttracks text not null);-create index playlist_name+create index if not exists playlist_nameon playlist (name);-create table property+create table if not exists property(id varchar(255) not nullprimary key,value varchar(255) default '' not null);-create table search+create table if not exists search(id varchar(255) not nullprimary key,@@ -153,13 +153,13 @@ create table searchfull_text varchar(255) default '' not null);-create index search_full_text+create index if not exists search_full_texton search (full_text);-create index search_table+create index if not exists search_tableon search ("table");-create table user+create table if not exists user(id varchar(255) not nullprimary key,