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.
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using Musify.Domain.Entities;
|
|
|
|
namespace Musify.Application.Contracts
|
|
{
|
|
public interface IDatabase
|
|
{
|
|
DbSet<User> Users { get; }
|
|
|
|
DbSet<PlayList> PlayLists { get; }
|
|
|
|
DbSet<Album> Albums { get; }
|
|
|
|
DbSet<UserAlbum> UserAlbums { get; }
|
|
|
|
DbSet<AlbumHasTrack> AlbumHasTracks { get; }
|
|
|
|
DbSet<Track> Tracks { get; }
|
|
|
|
DbSet<LocalTrack> LocalTracks { get; }
|
|
|
|
DbSet<ExternalTrack> ExternalTracks { get; }
|
|
|
|
DbSet<Artist> Artists { get; }
|
|
|
|
DbSet<TrackArtist> TrackArtists { get; }
|
|
|
|
DbSet<UserHasTrack> UserHasTracks { get; }
|
|
|
|
DbSet<PlayListHasTrack> PlayListHasTracks { get; }
|
|
|
|
DbSet<Upload> Uploads { get; }
|
|
|
|
DbSet<UploadIntent> UploadIntents { get; }
|
|
|
|
DbSet<ListeningHistory> ListeningHistories { get; }
|
|
|
|
Task<IDatabaseTransaction> BeginTransactionAsync(System.Data.IsolationLevel isolationLevel, CancellationToken cancellationToken);
|
|
|
|
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
|
|
}
|
|
} |