update database for surveylib

This commit is contained in:
Вячеслав 2025-05-26 01:10:01 +05:00
parent c080e09cfb
commit 9b3faed8fc
4 changed files with 386 additions and 0 deletions

View file

@ -119,6 +119,9 @@ namespace SurveyBackend.Infrastructure.Data.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int?>("CompletedBy")
.HasColumnType("INTEGER");
b.Property<DateTime>("FinishedAt")
.HasColumnType("TEXT");
@ -127,6 +130,8 @@ namespace SurveyBackend.Infrastructure.Data.Migrations
b.HasKey("Id");
b.HasIndex("CompletedBy");
b.HasIndex("SurveyId");
b.ToTable("Completions");
@ -256,6 +261,11 @@ namespace SurveyBackend.Infrastructure.Data.Migrations
modelBuilder.Entity("SurveyLib.Core.Models.Completion", b =>
{
b.HasOne("SurveyBackend.Core.Models.User", null)
.WithMany()
.HasForeignKey("CompletedBy")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("SurveyLib.Core.Models.Survey", "Survey")
.WithMany("Completions")
.HasForeignKey("SurveyId")