feat: keep track of user submissions, refs #4

This commit is contained in:
2025-05-24 18:46:29 +02:00
parent fbb6d1a409
commit 5fdd6ec1d0
5 changed files with 278 additions and 2 deletions

View File

@@ -54,10 +54,16 @@ namespace song_of_the_day.DataMigrations
b.Property<DateTime>("Date")
.HasColumnType("timestamp with time zone");
b.Property<bool>("HasUsedSuggestion")
.HasColumnType("boolean");
b.Property<int?>("SongId")
.HasColumnType("integer");
b.Property<bool>("Submitted")
b.Property<int>("SuggestionHelperId")
.HasColumnType("integer");
b.Property<bool>("UserHasSubmitted")
.HasColumnType("boolean");
b.Property<int?>("UserId")
@@ -67,6 +73,8 @@ namespace song_of_the_day.DataMigrations
b.HasIndex("SongId");
b.HasIndex("SuggestionHelperId");
b.HasIndex("UserId");
b.ToTable("SongSuggestions");
@@ -117,6 +125,9 @@ namespace song_of_the_day.DataMigrations
b.Property<string>("SignalMemberId")
.HasColumnType("text");
b.Property<bool>("WasChosenForSuggestionThisRound")
.HasColumnType("boolean");
b.HasKey("UserId");
b.ToTable("Users");
@@ -128,12 +139,20 @@ namespace song_of_the_day.DataMigrations
.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");
});
#pragma warning restore 612, 618