// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using YGNT.QuestionLibrary.EntityFrameworkCore;

namespace YGNT.QuestionLibrary.Migrations
{
    [DbContext(typeof(QuestionLibraryDbContext))]
    [Migration("20210204071430_addquestionConvertTask")]
    partial class addquestionConvertTask
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "3.1.10")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.BaseData.PaperStructureSetting", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("Code")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<bool>("IsDefault")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Param")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.ToTable("PaperStructureSettings");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.BaseData.QuestionType", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<bool>("IsStruct")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("QuestionStyle")
                        .HasColumnType("int");

                    b.Property<int>("Sort")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.ToTable("QuestionTypes");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Chapters.Chapter", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<long?>("ParentId")
                        .HasColumnType("bigint");

                    b.Property<string>("Remark")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("Sort")
                        .HasColumnType("int");

                    b.Property<int>("TextbookId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineId");

                    b.HasIndex("ParentId");

                    b.HasIndex("TextbookId");

                    b.ToTable("Chapters");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Chapters.ChapterTreePath", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<long>("Ancestor")
                        .HasColumnType("bigint");

                    b.Property<long>("Depth")
                        .HasColumnType("bigint");

                    b.Property<long>("Descendant")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.ToTable("ChapterTreePaths");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.CognitiveAbilities.CognitiveAbility", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.ToTable("CognitiveAbilities");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Disciplines.Discipline", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<int>("EducationCategoryId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("EducationCategoryId");

                    b.ToTable("Disciplines");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Disciplines.DisciplineQuestionType", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("QuestionTypeId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineId");

                    b.HasIndex("QuestionTypeId");

                    b.ToTable("DisciplineQuestionTypes");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Disciplines.UserDiscipline", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineId");

                    b.ToTable("UserDisciplines");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.EducationCategories.EducationCategory", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<bool>("IsActive")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.ToTable("EducationCategories");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.KnowledgePoints.KnowledgePoint", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<int?>("CognitiveAbilityId")
                        .HasColumnType("int");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastModificationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("LastModifierUserId")
                        .HasColumnType("bigint");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<long?>("ParentId")
                        .HasColumnType("bigint");

                    b.Property<int>("Sort")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("CognitiveAbilityId");

                    b.HasIndex("DisciplineId");

                    b.HasIndex("ParentId");

                    b.ToTable("KnowledgePoints");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.KnowledgePoints.KnowledgePointTreePath", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<long>("Ancestor")
                        .HasColumnType("bigint");

                    b.Property<long>("Depth")
                        .HasColumnType("bigint");

                    b.Property<long>("Descendant")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.ToTable("KnowledgePointTreePaths");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.Paper", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<Guid?>("AnswerFileId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("AnswerSheetFileId")
                        .HasColumnType("char(36)");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<long?>("DeleterUserId")
                        .HasColumnType("bigint");

                    b.Property<DateTime?>("DeletionTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long>("ExamTime")
                        .HasColumnType("bigint");

                    b.Property<Guid?>("FileId")
                        .HasColumnType("char(36)");

                    b.Property<Guid?>("FullPaperFileId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastModificationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("LastModifierUserId")
                        .HasColumnType("bigint");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<float>("PassingScore")
                        .HasColumnType("float");

                    b.Property<string>("ProducePath")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Remark")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("Status")
                        .HasColumnType("int");

                    b.Property<float>("TotalScore")
                        .HasColumnType("float");

                    b.HasKey("Id");

                    b.ToTable("Papers");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.PaperDiscipline", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<int>("PaperId")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineId");

                    b.HasIndex("PaperId");

                    b.ToTable("PaperDisciplines");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.PaperDisciplineQtSortSetting", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<int>("DisciplineQuestionTypeId")
                        .HasColumnType("int");

                    b.Property<int>("PaperId")
                        .HasColumnType("int");

                    b.Property<int>("Sort")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineId");

                    b.HasIndex("DisciplineQuestionTypeId");

                    b.ToTable("PaperDisciplineQtSortSettings");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.PaperQuestion", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<int>("DisciplineQuestionTypeId")
                        .HasColumnType("int");

                    b.Property<int>("PaperId")
                        .HasColumnType("int");

                    b.Property<long>("QuestionId")
                        .HasColumnType("bigint");

                    b.Property<int>("QuestionTypeSort")
                        .HasColumnType("int");

                    b.Property<float>("SingleScore")
                        .HasColumnType("float");

                    b.Property<int>("Sort")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineQuestionTypeId");

                    b.HasIndex("PaperId");

                    b.HasIndex("QuestionId");

                    b.ToTable("PaperQuestions");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.PaperSetting", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("PaperId")
                        .HasColumnType("int");

                    b.Property<string>("PaperStructureSettingCode")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("PaperStructureSettingId")
                        .HasColumnType("int");

                    b.Property<string>("Param")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.ToTable("PaperSettings");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Questions.Question", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime?>("AriseTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("ChapterId")
                        .HasColumnType("bigint");

                    b.Property<string>("CheckPoints")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<long?>("DeleterUserId")
                        .HasColumnType("bigint");

                    b.Property<DateTime?>("DeletionTime")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Difficulty")
                        .HasColumnType("int");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<int>("DisciplineQuestionTypeId")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastModificationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("LastModifierUserId")
                        .HasColumnType("bigint");

                    b.Property<long>("QuestionOriginId")
                        .HasColumnType("bigint");

                    b.Property<int>("QuestionTypeId")
                        .HasColumnType("int");

                    b.Property<string>("ShortName")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("ChapterId");

                    b.HasIndex("DisciplineId");

                    b.HasIndex("DisciplineQuestionTypeId");

                    b.HasIndex("QuestionOriginId");

                    b.HasIndex("QuestionTypeId");

                    b.ToTable("Questions");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Questions.QuestionKnowledgePoint", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<long>("KnowledgePointId")
                        .HasColumnType("bigint");

                    b.Property<long>("QuestionId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("KnowledgePointId");

                    b.HasIndex("QuestionId");

                    b.ToTable("QuestionKnowledgePoints");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Questions.QuestionOrigin", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<string>("Analysis")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Answer")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("Difficulty")
                        .HasColumnType("int");

                    b.Property<string>("Html")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<bool>("IsModified")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastModificationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("LastModifierUserId")
                        .HasColumnType("bigint");

                    b.Property<int>("QuestionConvertState")
                        .HasColumnType("int");

                    b.Property<string>("QuestionTypeName")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("ShortName")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.ToTable("QuestionOrigins");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Questions.Resolve", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Html")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<bool>("IsAnswer")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IsModified")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastModificationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("LastModifierUserId")
                        .HasColumnType("bigint");

                    b.Property<long>("QuestionOriginId")
                        .HasColumnType("bigint");

                    b.Property<int>("ResolveType")
                        .HasColumnType("int");

                    b.Property<string>("XmlPath")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("QuestionOriginId");

                    b.ToTable("QuestionResolves");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Tasks.PaperProduceTask", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("PaperId")
                        .HasColumnType("int");

                    b.Property<string>("Remark")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("TaskState")
                        .HasColumnType("int");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("PaperId");

                    b.ToTable("PaperProduceTasks");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Tasks.QuestionConvertTask", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<int>("QuestionConvertType")
                        .HasColumnType("int");

                    b.Property<long?>("QuestionId")
                        .HasColumnType("bigint");

                    b.Property<long>("QuestionOriginId")
                        .HasColumnType("bigint");

                    b.Property<string>("Remark")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("TaskState")
                        .HasColumnType("int");

                    b.HasKey("Id");

                    b.ToTable("QuestionConvertTasks");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Tasks.QuestionResolveTask", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("CreatorUserId")
                        .HasColumnType("bigint");

                    b.Property<long?>("DeleterUserId")
                        .HasColumnType("bigint");

                    b.Property<DateTime?>("DeletionTime")
                        .HasColumnType("datetime(6)");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<Guid>("FileId")
                        .HasColumnType("char(36)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime?>("LastModificationTime")
                        .HasColumnType("datetime(6)");

                    b.Property<long?>("LastModifierUserId")
                        .HasColumnType("bigint");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Remark")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<int>("State")
                        .HasColumnType("int");

                    b.Property<long>("TargetId")
                        .HasColumnType("bigint");

                    b.Property<int>("TargetType")
                        .HasColumnType("int");

                    b.Property<long>("UserId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineId");

                    b.ToTable("QuestionResolveTasks");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Tasks.ResolveTaskQuestion", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    b.Property<long>("QuestionOriginId")
                        .HasColumnType("bigint");

                    b.Property<long>("QuestionResolveTaskId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("QuestionOriginId");

                    b.HasIndex("QuestionResolveTaskId");

                    b.ToTable("ResolveTaskQuestions");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Textbooks.Textbook", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("DisciplineId")
                        .HasColumnType("int");

                    b.Property<bool>("IsActive")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("IsDeleted")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("DisciplineId");

                    b.ToTable("Textbooks");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Chapters.Chapter", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Chapters.Chapter", "ParentChapter")
                        .WithMany("ChildChapters")
                        .HasForeignKey("ParentId");

                    b.HasOne("YGNT.QuestionLibrary.Core.Textbooks.Textbook", "Textbook")
                        .WithMany()
                        .HasForeignKey("TextbookId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Disciplines.Discipline", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.EducationCategories.EducationCategory", "EducationCategory")
                        .WithMany("Disciplines")
                        .HasForeignKey("EducationCategoryId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Disciplines.DisciplineQuestionType", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.BaseData.QuestionType", "QuestionType")
                        .WithMany()
                        .HasForeignKey("QuestionTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Disciplines.UserDiscipline", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany("UserDisciplines")
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.KnowledgePoints.KnowledgePoint", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.CognitiveAbilities.CognitiveAbility", "CognitiveAbility")
                        .WithMany()
                        .HasForeignKey("CognitiveAbilityId");

                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.KnowledgePoints.KnowledgePoint", "ParentKnowledgePoint")
                        .WithMany("ChildKnowledgePoints")
                        .HasForeignKey("ParentId");
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.PaperDiscipline", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Papers.Paper", "Paper")
                        .WithMany("PaperDisciplines")
                        .HasForeignKey("PaperId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.PaperDisciplineQtSortSetting", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.DisciplineQuestionType", "DisciplineQuestionType")
                        .WithMany()
                        .HasForeignKey("DisciplineQuestionTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Papers.PaperQuestion", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.DisciplineQuestionType", "DisciplineQuestionType")
                        .WithMany()
                        .HasForeignKey("DisciplineQuestionTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Papers.Paper", "Paper")
                        .WithMany("PaperQuestions")
                        .HasForeignKey("PaperId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Questions.Question", "Question")
                        .WithMany()
                        .HasForeignKey("QuestionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Questions.Question", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Chapters.Chapter", "Chapter")
                        .WithMany()
                        .HasForeignKey("ChapterId");

                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.DisciplineQuestionType", "DisciplineQuestionType")
                        .WithMany()
                        .HasForeignKey("DisciplineQuestionTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Questions.QuestionOrigin", "QuestionOrigin")
                        .WithMany()
                        .HasForeignKey("QuestionOriginId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.BaseData.QuestionType", "QuestionType")
                        .WithMany()
                        .HasForeignKey("QuestionTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Questions.QuestionKnowledgePoint", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.KnowledgePoints.KnowledgePoint", "KnowledgePoint")
                        .WithMany("QuestionKnowledgePoints")
                        .HasForeignKey("KnowledgePointId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Questions.Question", "Question")
                        .WithMany("QuestionKnowledgePoints")
                        .HasForeignKey("QuestionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Questions.Resolve", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Questions.QuestionOrigin", "QuestionOrigin")
                        .WithMany("Resolves")
                        .HasForeignKey("QuestionOriginId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Tasks.PaperProduceTask", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Papers.Paper", "Paper")
                        .WithMany()
                        .HasForeignKey("PaperId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Tasks.QuestionResolveTask", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Tasks.ResolveTaskQuestion", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Questions.QuestionOrigin", "QuestionOrigin")
                        .WithMany()
                        .HasForeignKey("QuestionOriginId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("YGNT.QuestionLibrary.Core.Tasks.QuestionResolveTask", "QuestionResolveTask")
                        .WithMany()
                        .HasForeignKey("QuestionResolveTaskId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("YGNT.QuestionLibrary.Core.Textbooks.Textbook", b =>
                {
                    b.HasOne("YGNT.QuestionLibrary.Core.Disciplines.Discipline", "Discipline")
                        .WithMany()
                        .HasForeignKey("DisciplineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });
#pragma warning restore 612, 618
        }
    }
}
