Album is abstract with UserAlbum as its first table-per-type child, the same split Track already uses, so the YouTube albums can join later without moving anything. Tracks are linked through AlbumHasTrack rather than a column on the track itself: an external track is shared between users and the same song shows up in more than one album.
16 lines
370 B
C#
16 lines
370 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Musify.Domain.Entities
|
|
{
|
|
#pragma warning disable CS8618
|
|
public class UserAlbum : Album
|
|
{
|
|
[Required]
|
|
public required long OwnerUserId { get; set; }
|
|
|
|
[ForeignKey(nameof(OwnerUserId))]
|
|
public User Owner { get; set; }
|
|
}
|
|
}
|