diff --git a/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/20250418123442_Initial.Designer.cs b/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/20250418123442_Initial.Designer.cs
new file mode 100644
index 0000000..b8b673d
--- /dev/null
+++ b/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/20250418123442_Initial.Designer.cs
@@ -0,0 +1,321 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using SurveyBackend.Infrastructure.Data;
+
+#nullable disable
+
+namespace SurveyBackend.Infrastructure.Data.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20250418123442_Initial")]
+ partial class Initial
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.15");
+
+ modelBuilder.Entity("GroupUser", b =>
+ {
+ b.Property("GroupsId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UsersId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("GroupsId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("GroupUser");
+ });
+
+ modelBuilder.Entity("SurveyBackend.Core.Models.Group", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Label")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Groups");
+ });
+
+ modelBuilder.Entity("SurveyBackend.Core.Models.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Users");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Answer", b =>
+ {
+ b.Property("CompletionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("QuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("AnswerText")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("CompletionId", "QuestionId");
+
+ b.HasIndex("QuestionId");
+
+ b.ToTable("Answers");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.AnswerVariant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("MultipleAnswerQuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("QuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("SingleAnswerQuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MultipleAnswerQuestionId");
+
+ b.HasIndex("QuestionId");
+
+ b.HasIndex("SingleAnswerQuestionId");
+
+ b.ToTable("AnswerVariant");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Completion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("FinishedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("SurveyId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("SurveyId");
+
+ b.ToTable("Completions");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionBase", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Discriminator")
+ .IsRequired()
+ .HasMaxLength(34)
+ .HasColumnType("TEXT");
+
+ b.Property("SurveyId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("SurveyId");
+
+ b.ToTable("Questions");
+
+ b.HasDiscriminator().HasValue("QuestionBase");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Survey", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Surveys");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.MultipleAnswerQuestion", b =>
+ {
+ b.HasBaseType("SurveyLib.Core.Models.QuestionBase");
+
+ b.HasDiscriminator().HasValue("MultipleAnswerQuestion");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.SingleAnswerQuestion", b =>
+ {
+ b.HasBaseType("SurveyLib.Core.Models.QuestionBase");
+
+ b.HasDiscriminator().HasValue("SingleAnswerQuestion");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.TextQuestion", b =>
+ {
+ b.HasBaseType("SurveyLib.Core.Models.QuestionBase");
+
+ b.HasDiscriminator().HasValue("TextQuestion");
+ });
+
+ modelBuilder.Entity("GroupUser", b =>
+ {
+ b.HasOne("SurveyBackend.Core.Models.Group", null)
+ .WithMany()
+ .HasForeignKey("GroupsId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("SurveyBackend.Core.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Answer", b =>
+ {
+ b.HasOne("SurveyLib.Core.Models.Completion", "Completion")
+ .WithMany("Answers")
+ .HasForeignKey("CompletionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("SurveyLib.Core.Models.QuestionBase", "Question")
+ .WithMany("Answers")
+ .HasForeignKey("QuestionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Completion");
+
+ b.Navigation("Question");
+ });
+
+ 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()
+ .HasForeignKey("QuestionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("SurveyLib.Core.Models.QuestionVariants.SingleAnswerQuestion", null)
+ .WithMany("AnswerVariants")
+ .HasForeignKey("SingleAnswerQuestionId");
+
+ b.Navigation("Question");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Completion", b =>
+ {
+ b.HasOne("SurveyLib.Core.Models.Survey", "Survey")
+ .WithMany("Completions")
+ .HasForeignKey("SurveyId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Survey");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionBase", b =>
+ {
+ b.HasOne("SurveyLib.Core.Models.Survey", "Survey")
+ .WithMany("Questions")
+ .HasForeignKey("SurveyId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Survey");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Completion", b =>
+ {
+ b.Navigation("Answers");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionBase", b =>
+ {
+ b.Navigation("Answers");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Survey", b =>
+ {
+ b.Navigation("Completions");
+
+ 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
+ }
+ }
+}
diff --git a/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/20250418123442_Initial.cs b/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/20250418123442_Initial.cs
new file mode 100644
index 0000000..26fbf8b
--- /dev/null
+++ b/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/20250418123442_Initial.cs
@@ -0,0 +1,243 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace SurveyBackend.Infrastructure.Data.Migrations
+{
+ ///
+ public partial class Initial : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "Groups",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Label = table.Column(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Groups", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Surveys",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Title = table.Column(type: "TEXT", nullable: false),
+ Description = table.Column(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Surveys", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Users",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Email = table.Column(type: "TEXT", nullable: false),
+ FirstName = table.Column(type: "TEXT", nullable: false),
+ LastName = table.Column(type: "TEXT", nullable: false),
+ Password = table.Column(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Users", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Completions",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ SurveyId = table.Column(type: "INTEGER", nullable: false),
+ FinishedAt = table.Column(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Completions", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Completions_Surveys_SurveyId",
+ column: x => x.SurveyId,
+ principalTable: "Surveys",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Questions",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ SurveyId = table.Column(type: "INTEGER", nullable: false),
+ Title = table.Column(type: "TEXT", nullable: false),
+ Discriminator = table.Column(type: "TEXT", maxLength: 34, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Questions", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Questions_Surveys_SurveyId",
+ column: x => x.SurveyId,
+ principalTable: "Surveys",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "GroupUser",
+ columns: table => new
+ {
+ GroupsId = table.Column(type: "INTEGER", nullable: false),
+ UsersId = table.Column(type: "INTEGER", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_GroupUser", x => new { x.GroupsId, x.UsersId });
+ table.ForeignKey(
+ name: "FK_GroupUser_Groups_GroupsId",
+ column: x => x.GroupsId,
+ principalTable: "Groups",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_GroupUser_Users_UsersId",
+ column: x => x.UsersId,
+ principalTable: "Users",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Answers",
+ columns: table => new
+ {
+ CompletionId = table.Column(type: "INTEGER", nullable: false),
+ QuestionId = table.Column(type: "INTEGER", nullable: false),
+ AnswerText = table.Column(type: "TEXT", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Answers", x => new { x.CompletionId, x.QuestionId });
+ table.ForeignKey(
+ name: "FK_Answers_Completions_CompletionId",
+ column: x => x.CompletionId,
+ principalTable: "Completions",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_Answers_Questions_QuestionId",
+ column: x => x.QuestionId,
+ principalTable: "Questions",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AnswerVariant",
+ columns: table => new
+ {
+ Id = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ QuestionId = table.Column(type: "INTEGER", nullable: false),
+ Text = table.Column(type: "TEXT", nullable: false),
+ MultipleAnswerQuestionId = table.Column(type: "INTEGER", nullable: true),
+ SingleAnswerQuestionId = table.Column(type: "INTEGER", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AnswerVariant", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AnswerVariant_Questions_MultipleAnswerQuestionId",
+ column: x => x.MultipleAnswerQuestionId,
+ principalTable: "Questions",
+ principalColumn: "Id");
+ table.ForeignKey(
+ name: "FK_AnswerVariant_Questions_QuestionId",
+ column: x => x.QuestionId,
+ principalTable: "Questions",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_AnswerVariant_Questions_SingleAnswerQuestionId",
+ column: x => x.SingleAnswerQuestionId,
+ principalTable: "Questions",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Answers_QuestionId",
+ table: "Answers",
+ column: "QuestionId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AnswerVariant_MultipleAnswerQuestionId",
+ table: "AnswerVariant",
+ column: "MultipleAnswerQuestionId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AnswerVariant_QuestionId",
+ table: "AnswerVariant",
+ column: "QuestionId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AnswerVariant_SingleAnswerQuestionId",
+ table: "AnswerVariant",
+ column: "SingleAnswerQuestionId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Completions_SurveyId",
+ table: "Completions",
+ column: "SurveyId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_GroupUser_UsersId",
+ table: "GroupUser",
+ column: "UsersId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Questions_SurveyId",
+ table: "Questions",
+ column: "SurveyId");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Answers");
+
+ migrationBuilder.DropTable(
+ name: "AnswerVariant");
+
+ migrationBuilder.DropTable(
+ name: "GroupUser");
+
+ migrationBuilder.DropTable(
+ name: "Completions");
+
+ migrationBuilder.DropTable(
+ name: "Questions");
+
+ migrationBuilder.DropTable(
+ name: "Groups");
+
+ migrationBuilder.DropTable(
+ name: "Users");
+
+ migrationBuilder.DropTable(
+ name: "Surveys");
+ }
+ }
+}
diff --git a/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/ApplicationDbContextModelSnapshot.cs
new file mode 100644
index 0000000..db4d61e
--- /dev/null
+++ b/SurveyBackend/SurveyBackend.Infrastructure/Data/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -0,0 +1,318 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using SurveyBackend.Infrastructure.Data;
+
+#nullable disable
+
+namespace SurveyBackend.Infrastructure.Data.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ partial class ApplicationDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.15");
+
+ modelBuilder.Entity("GroupUser", b =>
+ {
+ b.Property("GroupsId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UsersId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("GroupsId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("GroupUser");
+ });
+
+ modelBuilder.Entity("SurveyBackend.Core.Models.Group", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Label")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Groups");
+ });
+
+ modelBuilder.Entity("SurveyBackend.Core.Models.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Email")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Password")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Users");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Answer", b =>
+ {
+ b.Property("CompletionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("QuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("AnswerText")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("CompletionId", "QuestionId");
+
+ b.HasIndex("QuestionId");
+
+ b.ToTable("Answers");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.AnswerVariant", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("MultipleAnswerQuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("QuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("SingleAnswerQuestionId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("MultipleAnswerQuestionId");
+
+ b.HasIndex("QuestionId");
+
+ b.HasIndex("SingleAnswerQuestionId");
+
+ b.ToTable("AnswerVariant");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Completion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("FinishedAt")
+ .HasColumnType("TEXT");
+
+ b.Property("SurveyId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("SurveyId");
+
+ b.ToTable("Completions");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionBase", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Discriminator")
+ .IsRequired()
+ .HasMaxLength(34)
+ .HasColumnType("TEXT");
+
+ b.Property("SurveyId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("SurveyId");
+
+ b.ToTable("Questions");
+
+ b.HasDiscriminator().HasValue("QuestionBase");
+
+ b.UseTphMappingStrategy();
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Survey", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.ToTable("Surveys");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.MultipleAnswerQuestion", b =>
+ {
+ b.HasBaseType("SurveyLib.Core.Models.QuestionBase");
+
+ b.HasDiscriminator().HasValue("MultipleAnswerQuestion");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.SingleAnswerQuestion", b =>
+ {
+ b.HasBaseType("SurveyLib.Core.Models.QuestionBase");
+
+ b.HasDiscriminator().HasValue("SingleAnswerQuestion");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionVariants.TextQuestion", b =>
+ {
+ b.HasBaseType("SurveyLib.Core.Models.QuestionBase");
+
+ b.HasDiscriminator().HasValue("TextQuestion");
+ });
+
+ modelBuilder.Entity("GroupUser", b =>
+ {
+ b.HasOne("SurveyBackend.Core.Models.Group", null)
+ .WithMany()
+ .HasForeignKey("GroupsId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("SurveyBackend.Core.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Answer", b =>
+ {
+ b.HasOne("SurveyLib.Core.Models.Completion", "Completion")
+ .WithMany("Answers")
+ .HasForeignKey("CompletionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("SurveyLib.Core.Models.QuestionBase", "Question")
+ .WithMany("Answers")
+ .HasForeignKey("QuestionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Completion");
+
+ b.Navigation("Question");
+ });
+
+ 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()
+ .HasForeignKey("QuestionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("SurveyLib.Core.Models.QuestionVariants.SingleAnswerQuestion", null)
+ .WithMany("AnswerVariants")
+ .HasForeignKey("SingleAnswerQuestionId");
+
+ b.Navigation("Question");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Completion", b =>
+ {
+ b.HasOne("SurveyLib.Core.Models.Survey", "Survey")
+ .WithMany("Completions")
+ .HasForeignKey("SurveyId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Survey");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionBase", b =>
+ {
+ b.HasOne("SurveyLib.Core.Models.Survey", "Survey")
+ .WithMany("Questions")
+ .HasForeignKey("SurveyId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Survey");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Completion", b =>
+ {
+ b.Navigation("Answers");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.QuestionBase", b =>
+ {
+ b.Navigation("Answers");
+ });
+
+ modelBuilder.Entity("SurveyLib.Core.Models.Survey", b =>
+ {
+ b.Navigation("Completions");
+
+ 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
+ }
+ }
+}