// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace song_of_the_day.DataMigrations { [DbContext(typeof(DataContext))] [Migration("20250720144512_explicitly model liked songs relationship")] partial class explicitlymodellikedsongsrelationship { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "9.0.3") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("LikedSongs", b => { b.Property("SongId") .HasColumnType("integer"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("SongId", "UserId"); b.HasIndex("UserId"); b.ToTable("LikedSongs"); }); modelBuilder.Entity("SmartPlaylistDefinition", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("CreatedByUserId") .HasColumnType("integer"); b.Property("Description") .HasColumnType("text"); b.Property("IncludesLikedSongs") .HasColumnType("boolean"); b.Property("IncludesUnCategorizedSongs") .HasColumnType("boolean"); b.Property("SpotifyPlaylistId") .HasColumnType("text"); b.Property("Title") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("CreatedByUserId"); b.ToTable("SmartPlaylistDefinitions"); }); modelBuilder.Entity("Song", b => { b.Property("SongId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SongId")); b.Property("Artist") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("Provider") .HasColumnType("integer"); b.Property("SmartPlaylistDefinitionId") .HasColumnType("integer"); b.Property("SmartPlaylistDefinitionId1") .HasColumnType("integer"); b.Property("SpotifyId") .HasColumnType("text"); b.Property("Url") .HasColumnType("text"); b.HasKey("SongId"); b.HasIndex("SmartPlaylistDefinitionId"); b.HasIndex("SmartPlaylistDefinitionId1"); b.ToTable("Songs"); }); modelBuilder.Entity("SongSuggestion", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Date") .HasColumnType("timestamp with time zone"); b.Property("HasUsedSuggestion") .HasColumnType("boolean"); b.Property("SongId") .HasColumnType("integer"); b.Property("SuggestionHelperId") .HasColumnType("integer"); b.Property("UserHasSubmitted") .HasColumnType("boolean"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("SongId"); b.HasIndex("SuggestionHelperId"); b.HasIndex("UserId"); b.ToTable("SongSuggestions"); }); modelBuilder.Entity("SuggestionHelper", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Description") .HasColumnType("text"); b.Property("SmartPlaylistDefinitionId") .HasColumnType("integer"); b.Property("Title") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("SmartPlaylistDefinitionId"); b.ToTable("SuggestionHelpers"); }); modelBuilder.Entity("User", b => { b.Property("UserId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("UserId")); b.Property("AssociationInProgress") .HasColumnType("boolean"); b.Property("IsIntroduced") .HasColumnType("boolean"); b.Property("LdapUserName") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("NickName") .HasColumnType("text"); b.Property("SignalMemberId") .HasColumnType("text"); b.Property("SpotifyAuthAccessToken") .HasColumnType("text"); b.Property("SpotifyAuthCreatedAt") .HasColumnType("timestamp with time zone"); b.Property("SpotifyAuthExpiresAfterSeconds") .HasColumnType("integer"); b.Property("SpotifyAuthRefreshToken") .HasColumnType("text"); b.Property("WasChosenForSuggestionThisRound") .HasColumnType("boolean"); b.HasKey("UserId"); b.ToTable("Users"); }); modelBuilder.Entity("LikedSongs", b => { b.HasOne("Song", null) .WithMany() .HasForeignKey("SongId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("User", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("SmartPlaylistDefinition", b => { b.HasOne("User", "CreatedBy") .WithMany() .HasForeignKey("CreatedByUserId"); b.Navigation("CreatedBy"); }); modelBuilder.Entity("Song", b => { b.HasOne("SmartPlaylistDefinition", null) .WithMany("ExplicitlyExcludedSongs") .HasForeignKey("SmartPlaylistDefinitionId"); b.HasOne("SmartPlaylistDefinition", null) .WithMany("ExplicitlyIncludedSongs") .HasForeignKey("SmartPlaylistDefinitionId1"); }); modelBuilder.Entity("SongSuggestion", b => { b.HasOne("Song", "Song") .WithMany() .HasForeignKey("SongId"); b.HasOne("SuggestionHelper", "SuggestionHelper") .WithMany() .HasForeignKey("SuggestionHelperId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("User", "User") .WithMany() .HasForeignKey("UserId"); b.Navigation("Song"); b.Navigation("SuggestionHelper"); b.Navigation("User"); }); modelBuilder.Entity("SuggestionHelper", b => { b.HasOne("SmartPlaylistDefinition", null) .WithMany("Categories") .HasForeignKey("SmartPlaylistDefinitionId"); }); modelBuilder.Entity("SmartPlaylistDefinition", b => { b.Navigation("Categories"); b.Navigation("ExplicitlyExcludedSongs"); b.Navigation("ExplicitlyIncludedSongs"); }); #pragma warning restore 612, 618 } } }