//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Shadow.Data;
#nullable disable
namespace Shadow.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Shadow.Entities.Album", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ArtistId")
.HasColumnType("integer");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("State")
.HasColumnType("integer");
b.Property("Uri")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ArtistId");
b.HasIndex("Uri")
.IsUnique();
b.ToTable("Albums");
});
modelBuilder.Entity("Shadow.Entities.AlbumInteraction", b =>
{
b.Property("AlbumId")
.HasColumnType("integer");
b.Property("UserId")
.HasColumnType("integer");
b.Property("Id")
.HasColumnType("integer");
b.Property("PlayDate")
.HasColumnType("timestamp with time zone");
b.Property("Starred")
.HasColumnType("boolean");
b.HasKey("AlbumId", "UserId");
b.HasIndex("UserId");
b.ToTable("AlbumInteractions");
});
modelBuilder.Entity("Shadow.Entities.Artist", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("NormalizedName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique();
b.ToTable("Artists");
});
modelBuilder.Entity("Shadow.Entities.Genre", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("NormalizedName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique();
b.ToTable("Genres");
});
modelBuilder.Entity("Shadow.Entities.GenreSong", b =>
{
b.Property("GenreId")
.HasColumnType("integer");
b.Property("SongId")
.HasColumnType("integer");
b.HasKey("GenreId", "SongId");
b.HasIndex("SongId");
b.ToTable("GenreSongs");
});
modelBuilder.Entity("Shadow.Entities.Image", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("SongId")
.HasColumnType("integer");
b.Property("State")
.HasColumnType("integer");
b.Property("Uri")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("SongId")
.IsUnique();
b.ToTable("Images");
});
modelBuilder.Entity("Shadow.Entities.Playlist", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CreatorId")
.HasColumnType("integer");
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("Uri")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("CreatorId");
b.HasIndex("Uri")
.IsUnique();
b.ToTable("Playlists");
});
modelBuilder.Entity("Shadow.Entities.PlaylistSong", b =>
{
b.Property("PlaylistId")
.HasColumnType("integer");
b.Property("SongId")
.HasColumnType("integer");
b.Property("Index")
.HasColumnType("integer");
b.HasKey("PlaylistId", "SongId");
b.HasIndex("SongId");
b.ToTable("PlaylistSongs");
});
modelBuilder.Entity("Shadow.Entities.PlaylistUser", b =>
{
b.Property("PlaylistId")
.HasColumnType("integer");
b.Property("UserId")
.HasColumnType("integer");
b.HasKey("PlaylistId", "UserId");
b.HasIndex("UserId");
b.ToTable("PlaylistUsers");
});
modelBuilder.Entity("Shadow.Entities.Radio", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Homepage")
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("NormalizedName")
.IsRequired()
.HasColumnType("text");
b.Property("Url")
.IsRequired()
.HasColumnType("text");
b.Property("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique();
b.HasIndex("UserId");
b.ToTable("Radios");
});
modelBuilder.Entity("Shadow.Entities.Song", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AlbumId")
.HasColumnType("integer");
b.Property("ArtistId")
.HasColumnType("integer");
b.Property("BitDepth")
.HasColumnType("integer");
b.Property("Bitrate")
.HasColumnType("integer");
b.Property("Channels")
.HasColumnType("integer");
b.Property("Comment")
.HasColumnType("text");
b.Property("Date")
.HasColumnType("timestamp with time zone");
b.Property("DiscNumber")
.HasColumnType("integer");
b.Property("Duration")
.HasColumnType("integer");
b.Property("Filepath")
.IsRequired()
.HasColumnType("text");
b.Property("Filetype")
.IsRequired()
.HasColumnType("text");
b.Property("ImageId")
.HasColumnType("integer");
b.Property("Index")
.HasColumnType("integer");
b.Property("SamplingRate")
.HasColumnType("integer");
b.Property("Size")
.HasColumnType("integer");
b.Property("State")
.HasColumnType("integer");
b.Property("Title")
.IsRequired()
.HasColumnType("text");
b.Property("TrackNumber")
.HasColumnType("integer");
b.Property("Uri")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AlbumId");
b.HasIndex("ArtistId");
b.HasIndex("Uri")
.IsUnique();
b.ToTable("Songs");
});
modelBuilder.Entity("Shadow.Entities.SongInteraction", b =>
{
b.Property("SongId")
.HasColumnType("integer");
b.Property("UserId")
.HasColumnType("integer");
b.Property("Id")
.HasColumnType("integer");
b.Property("PlayCount")
.HasColumnType("integer");
b.Property("Rating")
.HasColumnType("integer");
b.Property("Starred")
.HasColumnType("boolean");
b.HasKey("SongId", "UserId");
b.HasIndex("UserId");
b.ToTable("SongInteractions");
});
modelBuilder.Entity("Shadow.Entities.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("NormalizedName")
.IsRequired()
.HasColumnType("text");
b.Property("Password")
.IsRequired()
.HasColumnType("text");
b.Property("Role")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("Shadow.Entities.Album", b =>
{
b.HasOne("Shadow.Entities.Artist", "Artist")
.WithMany("Albums")
.HasForeignKey("ArtistId");
b.Navigation("Artist");
});
modelBuilder.Entity("Shadow.Entities.AlbumInteraction", b =>
{
b.HasOne("Shadow.Entities.Album", "Album")
.WithMany()
.HasForeignKey("AlbumId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Shadow.Entities.User", "User")
.WithMany("AlbumInteractions")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Album");
b.Navigation("User");
});
modelBuilder.Entity("Shadow.Entities.GenreSong", b =>
{
b.HasOne("Shadow.Entities.Genre", "Genre")
.WithMany("GenreSongPair")
.HasForeignKey("GenreId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Shadow.Entities.Song", "Song")
.WithMany("GenreSongPair")
.HasForeignKey("SongId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Genre");
b.Navigation("Song");
});
modelBuilder.Entity("Shadow.Entities.Image", b =>
{
b.HasOne("Shadow.Entities.Song", "Song")
.WithOne("Image")
.HasForeignKey("Shadow.Entities.Image", "SongId");
b.Navigation("Song");
});
modelBuilder.Entity("Shadow.Entities.Playlist", b =>
{
b.HasOne("Shadow.Entities.User", "Creator")
.WithMany("Playlists")
.HasForeignKey("CreatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Creator");
});
modelBuilder.Entity("Shadow.Entities.PlaylistSong", b =>
{
b.HasOne("Shadow.Entities.Playlist", "Playlist")
.WithMany()
.HasForeignKey("PlaylistId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Shadow.Entities.Song", "Song")
.WithMany()
.HasForeignKey("SongId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Playlist");
b.Navigation("Song");
});
modelBuilder.Entity("Shadow.Entities.PlaylistUser", b =>
{
b.HasOne("Shadow.Entities.Playlist", "Playlist")
.WithMany("AuthorizedPlaylistUsers")
.HasForeignKey("PlaylistId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Shadow.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Playlist");
b.Navigation("User");
});
modelBuilder.Entity("Shadow.Entities.Radio", b =>
{
b.HasOne("Shadow.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("Shadow.Entities.Song", b =>
{
b.HasOne("Shadow.Entities.Album", "Album")
.WithMany("Songs")
.HasForeignKey("AlbumId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Shadow.Entities.Artist", "Artist")
.WithMany("Songs")
.HasForeignKey("ArtistId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Album");
b.Navigation("Artist");
});
modelBuilder.Entity("Shadow.Entities.SongInteraction", b =>
{
b.HasOne("Shadow.Entities.Song", "Song")
.WithMany()
.HasForeignKey("SongId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Shadow.Entities.User", "User")
.WithMany("SongInteractions")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Song");
b.Navigation("User");
});
modelBuilder.Entity("Shadow.Entities.Album", b =>
{
b.Navigation("Songs");
});
modelBuilder.Entity("Shadow.Entities.Artist", b =>
{
b.Navigation("Albums");
b.Navigation("Songs");
});
modelBuilder.Entity("Shadow.Entities.Genre", b =>
{
b.Navigation("GenreSongPair");
});
modelBuilder.Entity("Shadow.Entities.Playlist", b =>
{
b.Navigation("AuthorizedPlaylistUsers");
});
modelBuilder.Entity("Shadow.Entities.Song", b =>
{
b.Navigation("GenreSongPair");
b.Navigation("Image");
});
modelBuilder.Entity("Shadow.Entities.User", b =>
{
b.Navigation("AlbumInteractions");
b.Navigation("Playlists");
b.Navigation("SongInteractions");
});
#pragma warning restore 612, 618
}
}
}