add migrations for new models
This commit is contained in:
parent
e8d9895795
commit
3bc2181e68
2 changed files with 81 additions and 29 deletions
|
|
@ -99,27 +99,17 @@ namespace SurveyBackend.Infrastructure.Data.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("MultipleAnswerQuestionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuestionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("SingleAnswerQuestionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MultipleAnswerQuestionId");
|
||||
|
||||
b.HasIndex("QuestionId");
|
||||
|
||||
b.HasIndex("SingleAnswerQuestionId");
|
||||
|
||||
b.ToTable("AnswerVariant");
|
||||
});
|
||||
|
||||
|
|
@ -252,20 +242,12 @@ namespace SurveyBackend.Infrastructure.Data.Migrations
|
|||
|
||||
modelBuilder.Entity("SurveyLib.Core.Models.AnswerVariant", b =>
|
||||
{
|
||||
b.HasOne("SurveyLib.Core.Models.QuestionVariants.MultipleAnswerQuestion", null)
|
||||
.WithMany("AnswerVariants")
|
||||
.HasForeignKey("MultipleAnswerQuestionId");
|
||||
|
||||
b.HasOne("SurveyLib.Core.Models.QuestionBase", "Question")
|
||||
.WithMany()
|
||||
.WithMany("AnswerVariants")
|
||||
.HasForeignKey("QuestionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("SurveyLib.Core.Models.QuestionVariants.SingleAnswerQuestion", null)
|
||||
.WithMany("AnswerVariants")
|
||||
.HasForeignKey("SingleAnswerQuestionId");
|
||||
|
||||
b.Navigation("Question");
|
||||
});
|
||||
|
||||
|
|
@ -306,6 +288,8 @@ namespace SurveyBackend.Infrastructure.Data.Migrations
|
|||
|
||||
modelBuilder.Entity("SurveyLib.Core.Models.QuestionBase", b =>
|
||||
{
|
||||
b.Navigation("AnswerVariants");
|
||||
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
|
|
@ -315,16 +299,6 @@ namespace SurveyBackend.Infrastructure.Data.Migrations
|
|||
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.MultipleAnswerQuestion", b =>
|
||||
{
|
||||
b.Navigation("AnswerVariants");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.SingleAnswerQuestion", b =>
|
||||
{
|
||||
b.Navigation("AnswerVariants");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue