Added but did not complete the repository for cover art, updated migration script to create migration for CoverArt, and prepping for the cover art api

This commit is contained in:
amazing-username
2019-07-07 15:02:38 -04:00
parent 82686f5c33
commit 0932be2f2b
7 changed files with 142 additions and 1 deletions
+9
View File
@@ -46,6 +46,12 @@ namespace Icarus.Database.Contexts
.HasForeignKey(s => s.YearId)
.OnDelete(DeleteBehavior.SetNull);
modelBuilder.Entity<Song>()
.HasOne(s => s.SongCoverArt)
.WithMany(ca => ca.Songs)
.HasForeignKey(s => s.CoverArtId)
.OnDelete(DeleteBehavior.SetNull);
modelBuilder.Entity<Song>()
.Property(s => s.Year)
.IsRequired(false);
@@ -61,6 +67,9 @@ namespace Icarus.Database.Contexts
modelBuilder.Entity<Song>()
.Property(s => s.AlbumId)
.IsRequired(false);
modelBuilder.Entity<Song>()
.Property(s => s.CoverArtId)
.IsRequired(false);
}
}
}