Projektdateien hinzufügen.
This commit is contained in:
1 parent
0682df4d16
commit
749bdb5179
142 files changed
+63622
No files matched your search
+159
@@ -0,0 +1,159 @@
|
||||
// <auto-generated />
|
||||
using FWLAZ_Web.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FWLAZ_Web.Migrations
|
||||
{
|
||||
[DbContext(typeof(LocalDbContext))]
|
||||
[Migration("20240901110836_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsCorrect")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuestionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuestionId");
|
||||
|
||||
b.ToTable("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("QuizId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuizId");
|
||||
|
||||
b.ToTable("QuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("QuestionGroupsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuestionsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("QuestionGroupsId", "QuestionsId");
|
||||
|
||||
b.HasIndex("QuestionsId");
|
||||
|
||||
b.ToTable("QuestionQuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Question", "Question")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("QuestionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Quiz", "Quiz")
|
||||
.WithMany("Questiongroups")
|
||||
.HasForeignKey("QuizId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.QuestionGroup", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionGroupsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FWLAZ_Web.Data.Question", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Navigation("Questiongroups");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FWLAZ_Web.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Initial : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Question",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Text = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Question", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Quiz",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Quiz", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Answers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Text = table.Column<string>(type: "TEXT", nullable: false),
|
||||
IsCorrect = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
QuestionId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Answers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Answers_Question_QuestionId",
|
||||
column: x => x.QuestionId,
|
||||
principalTable: "Question",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "QuestionGroup",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
QuizId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_QuestionGroup", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_QuestionGroup_Quiz_QuizId",
|
||||
column: x => x.QuizId,
|
||||
principalTable: "Quiz",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "QuestionQuestionGroup",
|
||||
columns: table => new
|
||||
{
|
||||
QuestionGroupsId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
QuestionsId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_QuestionQuestionGroup", x => new { x.QuestionGroupsId, x.QuestionsId });
|
||||
table.ForeignKey(
|
||||
name: "FK_QuestionQuestionGroup_QuestionGroup_QuestionGroupsId",
|
||||
column: x => x.QuestionGroupsId,
|
||||
principalTable: "QuestionGroup",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_QuestionQuestionGroup_Question_QuestionsId",
|
||||
column: x => x.QuestionsId,
|
||||
principalTable: "Question",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Answers_QuestionId",
|
||||
table: "Answers",
|
||||
column: "QuestionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_QuestionGroup_QuizId",
|
||||
table: "QuestionGroup",
|
||||
column: "QuizId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_QuestionQuestionGroup_QuestionsId",
|
||||
table: "QuestionQuestionGroup",
|
||||
column: "QuestionsId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Answers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "QuestionQuestionGroup");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "QuestionGroup");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Question");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Quiz");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
// <auto-generated />
|
||||
using FWLAZ_Web.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FWLAZ_Web.Migrations
|
||||
{
|
||||
[DbContext(typeof(LocalDbContext))]
|
||||
[Migration("20240901142240_AddQuizRelationToQuestions")]
|
||||
partial class AddQuizRelationToQuestions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsCorrect")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuestionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuestionId");
|
||||
|
||||
b.ToTable("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuizId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuizId");
|
||||
|
||||
b.ToTable("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("QuizId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuizId");
|
||||
|
||||
b.ToTable("QuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("QuestionGroupsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuestionsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("QuestionGroupsId", "QuestionsId");
|
||||
|
||||
b.HasIndex("QuestionsId");
|
||||
|
||||
b.ToTable("QuestionQuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Question", "Question")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("QuestionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Quiz", "Quiz")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("QuizId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Quiz", "Quiz")
|
||||
.WithMany("Questiongroups")
|
||||
.HasForeignKey("QuizId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.QuestionGroup", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionGroupsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FWLAZ_Web.Data.Question", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Navigation("Questiongroups");
|
||||
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FWLAZ_Web.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddQuizRelationToQuestions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "QuizId",
|
||||
table: "Question",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Question_QuizId",
|
||||
table: "Question",
|
||||
column: "QuizId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Question_Quiz_QuizId",
|
||||
table: "Question",
|
||||
column: "QuizId",
|
||||
principalTable: "Quiz",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Question_Quiz_QuizId",
|
||||
table: "Question");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Question_QuizId",
|
||||
table: "Question");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "QuizId",
|
||||
table: "Question");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
// <auto-generated />
|
||||
using FWLAZ_Web.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FWLAZ_Web.Migrations
|
||||
{
|
||||
[DbContext(typeof(LocalDbContext))]
|
||||
[Migration("20240901171130_AddPositions")]
|
||||
partial class AddPositions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsCorrect")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Position")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("QuestionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuestionId");
|
||||
|
||||
b.ToTable("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Number")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuizId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuizId");
|
||||
|
||||
b.ToTable("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuizId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuizId");
|
||||
|
||||
b.ToTable("QuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("QuestionGroupsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuestionsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("QuestionGroupsId", "QuestionsId");
|
||||
|
||||
b.HasIndex("QuestionsId");
|
||||
|
||||
b.ToTable("QuestionQuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Question", "Question")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("QuestionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Quiz", "Quiz")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("QuizId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Quiz", "Quiz")
|
||||
.WithMany("Questiongroups")
|
||||
.HasForeignKey("QuizId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.QuestionGroup", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionGroupsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FWLAZ_Web.Data.Question", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Navigation("Questiongroups");
|
||||
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FWLAZ_Web.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPositions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Order",
|
||||
table: "QuestionGroup",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Number",
|
||||
table: "Question",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Position",
|
||||
table: "Answers",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Order",
|
||||
table: "QuestionGroup");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Number",
|
||||
table: "Question");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Position",
|
||||
table: "Answers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
// <auto-generated />
|
||||
using FWLAZ_Web.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FWLAZ_Web.Migrations
|
||||
{
|
||||
[DbContext(typeof(LocalDbContext))]
|
||||
partial class LocalDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.8");
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("IsCorrect")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Position")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("QuestionId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuestionId");
|
||||
|
||||
b.ToTable("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Number")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuizId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuizId");
|
||||
|
||||
b.ToTable("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Order")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuizId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("QuizId");
|
||||
|
||||
b.ToTable("QuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.Property<int>("QuestionGroupsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("QuestionsId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("QuestionGroupsId", "QuestionsId");
|
||||
|
||||
b.HasIndex("QuestionsId");
|
||||
|
||||
b.ToTable("QuestionQuestionGroup");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Answer", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Question", "Question")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("QuestionId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Question");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Quiz", "Quiz")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("QuizId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.QuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.Quiz", "Quiz")
|
||||
.WithMany("Questiongroups")
|
||||
.HasForeignKey("QuizId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Quiz");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuestionQuestionGroup", b =>
|
||||
{
|
||||
b.HasOne("FWLAZ_Web.Data.QuestionGroup", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionGroupsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FWLAZ_Web.Data.Question", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("QuestionsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Question", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FWLAZ_Web.Data.Quiz", b =>
|
||||
{
|
||||
b.Navigation("Questiongroups");
|
||||
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user