// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using TechHelper.Context;

#nullable disable

namespace TechHelper.Server.Migrations
{
    [DbContext(typeof(ApplicationContext))]
    [Migration("20250929035019_init")]
    partial class init
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.16")
                .HasAnnotation("Proxies:ChangeTracking", false)
                .HasAnnotation("Proxies:CheckEquality", false)
                .HasAnnotation("Proxies:LazyLoading", true)
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);

            modelBuilder.Entity("Entities.Contracts.Class", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("class_id");

                    b.Property<string>("ClassName")
                        .IsRequired()
                        .HasMaxLength(30)
                        .HasColumnType("varchar(30)")
                        .HasColumnName("class_name");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("created_at");

                    b.Property<Guid>("GradeId")
                        .HasColumnType("char(36)")
                        .HasColumnName("grade_id");

                    b.Property<Guid?>("HeadTeacherId")
                        .HasColumnType("char(36)")
                        .HasColumnName("head_teacher_id");

                    b.Property<byte>("Index")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("index");

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

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("updated_at");

                    b.HasKey("Id");

                    b.HasIndex("GradeId");

                    b.HasIndex("HeadTeacherId");

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

            modelBuilder.Entity("Entities.Contracts.ClassUser", b =>
                {
                    b.Property<Guid>("ClassId")
                        .HasColumnType("char(36)")
                        .HasColumnName("class_id")
                        .HasColumnOrder(0);

                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)")
                        .HasColumnName("student_id")
                        .HasColumnOrder(1);

                    b.Property<DateTime>("EnrollmentDate")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("enrollment_date");

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

                    b.HasKey("ClassId", "UserId");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Entities.Contracts.Exam", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("created_at");

                    b.Property<Guid>("CreatorId")
                        .HasColumnType("char(36)")
                        .HasColumnName("created_by");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("longtext")
                        .HasColumnName("description");

                    b.Property<DateTime>("DueDate")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("due_date");

                    b.Property<Guid>("ExamStructId")
                        .HasColumnType("char(36)")
                        .HasColumnName("exam_struct_id");

                    b.Property<Guid>("ExamTypeId")
                        .HasColumnType("char(36)")
                        .HasColumnName("exam_type_id");

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

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext")
                        .HasColumnName("name");

                    b.Property<float>("Score")
                        .HasColumnType("float")
                        .HasColumnName("score");

                    b.Property<Guid>("SubjectId")
                        .HasColumnType("char(36)")
                        .HasColumnName("subject_id");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("varchar(255)")
                        .HasColumnName("title");

                    b.Property<byte>("TotalQuestions")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("total_points");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("updated_at");

                    b.HasKey("Id");

                    b.HasIndex("CreatorId");

                    b.HasIndex("ExamStructId")
                        .IsUnique();

                    b.HasIndex("ExamTypeId");

                    b.HasIndex("SubjectId");

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

            modelBuilder.Entity("Entities.Contracts.ExamAttachment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<Guid>("AssignmentId")
                        .HasColumnType("char(36)")
                        .HasColumnName("assignment_id");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("varchar(255)")
                        .HasColumnName("file_name");

                    b.Property<string>("FilePath")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("varchar(255)")
                        .HasColumnName("file_path");

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

                    b.Property<DateTime>("UploadedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("uploaded_at");

                    b.HasKey("Id");

                    b.HasIndex("AssignmentId");

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

            modelBuilder.Entity("Entities.Contracts.ExamQuestion", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("created_at");

                    b.Property<byte>("Index")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("question_number");

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

                    b.Property<Guid?>("ParentExamQuestionId")
                        .HasColumnType("char(36)")
                        .HasColumnName("parent_question_group_id");

                    b.Property<Guid?>("QuestionContextId")
                        .HasColumnType("char(36)")
                        .HasColumnName("description");

                    b.Property<Guid?>("QuestionId")
                        .HasColumnType("char(36)")
                        .HasColumnName("question_id");

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

                    b.Property<float?>("Score")
                        .HasColumnType("float")
                        .HasColumnName("score");

                    b.Property<string>("Sequence")
                        .IsRequired()
                        .HasColumnType("longtext")
                        .HasColumnName("sequence");

                    b.Property<string>("Title")
                        .HasMaxLength(1024)
                        .HasColumnType("varchar(1024)")
                        .HasColumnName("title");

                    b.HasKey("Id");

                    b.HasIndex("ParentExamQuestionId");

                    b.HasIndex("QuestionContextId");

                    b.HasIndex("QuestionId");

                    b.HasIndex("QuestionTypeId");

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

            modelBuilder.Entity("Entities.Contracts.ExamType", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("longtext")
                        .HasColumnName("description");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)")
                        .HasColumnName("name");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.Contracts.Grade", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("grade_id");

                    b.Property<byte>("GradeLevel")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("grade_level");

                    b.Property<string>("GradeName")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)")
                        .HasColumnName("grade_name");

                    b.Property<Guid>("SchoolId")
                        .HasColumnType("char(36)")
                        .HasColumnName("school_id");

                    b.HasKey("Id");

                    b.HasIndex("SchoolId");

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

            modelBuilder.Entity("Entities.Contracts.KeyPoint", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("varchar(255)");

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

                    b.HasKey("Id");

                    b.HasIndex("LessonID");

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

            modelBuilder.Entity("Entities.Contracts.Lesson", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("longtext");

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

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("varchar(255)");

                    b.HasKey("Id");

                    b.HasIndex("TextbookID");

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

            modelBuilder.Entity("Entities.Contracts.LessonQuestion", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

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

                    b.Property<string>("Question")
                        .IsRequired()
                        .HasMaxLength(65535)
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("LessonID");

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

            modelBuilder.Entity("Entities.Contracts.Question", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<string>("Answer")
                        .HasMaxLength(65535)
                        .HasColumnType("longtext")
                        .HasColumnName("answer");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("created_at");

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

                    b.Property<Guid?>("KeyPointId")
                        .HasColumnType("char(36)")
                        .HasColumnName("key_point");

                    b.Property<Guid?>("LessonId")
                        .HasColumnType("char(36)")
                        .HasColumnName("lesson");

                    b.Property<string>("Options")
                        .HasColumnType("longtext")
                        .HasColumnName("options");

                    b.Property<Guid>("QuestioTypeId")
                        .HasColumnType("char(36)")
                        .HasColumnName("type");

                    b.Property<Guid>("SubjectId")
                        .HasColumnType("char(36)")
                        .HasColumnName("subject_area");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(65535)
                        .HasColumnType("longtext")
                        .HasColumnName("title");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("updated_at");

                    b.HasKey("Id");

                    b.HasIndex("KeyPointId");

                    b.HasIndex("LessonId");

                    b.HasIndex("QuestioTypeId");

                    b.HasIndex("SubjectId");

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

            modelBuilder.Entity("Entities.Contracts.QuestionContext", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.Contracts.QuestionType", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("longtext")
                        .HasColumnName("description");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)")
                        .HasColumnName("name");

                    b.Property<string>("ScoreRule")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)")
                        .HasColumnName("score_rule");

                    b.Property<Guid>("SubjectId")
                        .HasColumnType("char(36)")
                        .HasColumnName("subject_id");

                    b.HasKey("Id");

                    b.HasIndex("SubjectId");

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

            modelBuilder.Entity("Entities.Contracts.School", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<string>("Address")
                        .IsRequired()
                        .HasMaxLength(100)
                        .HasColumnType("varchar(100)")
                        .HasColumnName("address");

                    b.Property<DateTime>("CreateTime")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("create_time");

                    b.Property<string>("SchoolName")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("varchar(50)")
                        .HasColumnName("school_name");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.Contracts.Subject", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("longtext")
                        .HasColumnName("description");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(20)
                        .HasColumnType("varchar(20)")
                        .HasColumnName("name");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.Contracts.Submission", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<byte>("AttemptNumber")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("attempt_number");

                    b.Property<Guid>("ClassId")
                        .HasColumnType("char(36)")
                        .HasColumnName("class_id");

                    b.Property<byte>("ErrorQuesNum")
                        .HasColumnType("tinyint unsigned");

                    b.Property<Guid>("ExamId")
                        .HasColumnType("char(36)")
                        .HasColumnName("exam_id");

                    b.Property<DateTime?>("GradedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("graded_at");

                    b.Property<Guid?>("GraderId")
                        .HasColumnType("char(36)")
                        .HasColumnName("graded_by");

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

                    b.Property<string>("OverallFeedback")
                        .HasColumnType("longtext")
                        .HasColumnName("overall_feedback");

                    b.Property<float>("OverallGrade")
                        .HasColumnType("float")
                        .HasColumnName("overall_grade");

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

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)")
                        .HasColumnName("student_id");

                    b.Property<DateTime>("SubmissionTime")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("submission_time");

                    b.Property<byte>("TotalQuesNum")
                        .HasColumnType("tinyint unsigned");

                    b.Property<byte>("TotalScore")
                        .HasColumnType("tinyint unsigned");

                    b.HasKey("Id");

                    b.HasIndex("ClassId");

                    b.HasIndex("ExamId");

                    b.HasIndex("GraderId");

                    b.HasIndex("StudentId");

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

            modelBuilder.Entity("Entities.Contracts.SubmissionDetail", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("created_at");

                    b.Property<Guid>("ExamQuestionId")
                        .HasColumnType("char(36)")
                        .HasColumnName("assignment_question_id");

                    b.Property<bool?>("IsCorrect")
                        .HasColumnType("tinyint(1)")
                        .HasColumnName("is_correct");

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

                    b.Property<float?>("PointsAwarded")
                        .HasColumnType("float")
                        .HasColumnName("points_awarded");

                    b.Property<string>("StudentAnswer")
                        .HasColumnType("longtext")
                        .HasColumnName("student_answer");

                    b.Property<Guid>("StudentId")
                        .HasColumnType("char(36)")
                        .HasColumnName("student_id");

                    b.Property<Guid>("SubmissionId")
                        .HasColumnType("char(36)")
                        .HasColumnName("submission_id");

                    b.Property<string>("TeacherFeedback")
                        .HasColumnType("longtext")
                        .HasColumnName("teacher_feedback");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("updated_at");

                    b.HasKey("Id");

                    b.HasIndex("ExamQuestionId");

                    b.HasIndex("StudentId");

                    b.HasIndex("SubmissionId");

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

            modelBuilder.Entity("Entities.Contracts.Textbook", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<byte>("Grade")
                        .HasColumnType("tinyint unsigned");

                    b.Property<byte>("Publisher")
                        .HasColumnType("tinyint unsigned");

                    b.Property<byte>("SubjectArea")
                        .HasColumnType("tinyint unsigned");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.Contracts.User", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

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

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext");

                    b.Property<string>("DisplayName")
                        .HasColumnType("longtext");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

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

                    b.Property<string>("HomeAddress")
                        .HasColumnType("longtext");

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

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

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("longtext");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("longtext");

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

                    b.Property<string>("RefreshToken")
                        .HasColumnType("longtext");

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

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

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("longtext");

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

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

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex");

                    b.HasIndex("TeachSubjectId");

                    b.ToTable("AspNetUsers", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256)");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex");

                    b.ToTable("AspNetRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext");

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

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext");

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

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("longtext");

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

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

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

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles", (string)null);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
                {
                    b.Property<Guid>("UserId")
                        .HasColumnType("char(36)");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("Name")
                        .HasColumnType("varchar(255)");

                    b.Property<string>("Value")
                        .HasColumnType("longtext");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens", (string)null);
                });

            modelBuilder.Entity("Entities.Contracts.Class", b =>
                {
                    b.HasOne("Entities.Contracts.Grade", "Grade")
                        .WithMany("Classes")
                        .HasForeignKey("GradeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.User", "HeadTeacher")
                        .WithMany()
                        .HasForeignKey("HeadTeacherId");

                    b.Navigation("Grade");

                    b.Navigation("HeadTeacher");
                });

            modelBuilder.Entity("Entities.Contracts.ClassUser", b =>
                {
                    b.HasOne("Entities.Contracts.Class", "Class")
                        .WithMany("ClassUsers")
                        .HasForeignKey("ClassId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.User", "User")
                        .WithMany("UserInjoinedClass")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Class");

                    b.Navigation("User");
                });

            modelBuilder.Entity("Entities.Contracts.Exam", b =>
                {
                    b.HasOne("Entities.Contracts.User", "Creator")
                        .WithMany("CreatedExams")
                        .HasForeignKey("CreatorId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.ExamQuestion", "ExamStruct")
                        .WithOne("Exam")
                        .HasForeignKey("Entities.Contracts.Exam", "ExamStructId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.ExamType", "ExamType")
                        .WithMany("Exams")
                        .HasForeignKey("ExamTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.Subject", "Subject")
                        .WithMany()
                        .HasForeignKey("SubjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Creator");

                    b.Navigation("ExamStruct");

                    b.Navigation("ExamType");

                    b.Navigation("Subject");
                });

            modelBuilder.Entity("Entities.Contracts.ExamAttachment", b =>
                {
                    b.HasOne("Entities.Contracts.Exam", "Exam")
                        .WithMany("ExamAttachments")
                        .HasForeignKey("AssignmentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Exam");
                });

            modelBuilder.Entity("Entities.Contracts.ExamQuestion", b =>
                {
                    b.HasOne("Entities.Contracts.ExamQuestion", "ParentExamQuestion")
                        .WithMany("ChildExamQuestions")
                        .HasForeignKey("ParentExamQuestionId");

                    b.HasOne("Entities.Contracts.QuestionContext", "QuestionContext")
                        .WithMany("Questions")
                        .HasForeignKey("QuestionContextId");

                    b.HasOne("Entities.Contracts.Question", "Question")
                        .WithMany("ExamQuestions")
                        .HasForeignKey("QuestionId");

                    b.HasOne("Entities.Contracts.QuestionType", "Type")
                        .WithMany()
                        .HasForeignKey("QuestionTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ParentExamQuestion");

                    b.Navigation("Question");

                    b.Navigation("QuestionContext");

                    b.Navigation("Type");
                });

            modelBuilder.Entity("Entities.Contracts.Grade", b =>
                {
                    b.HasOne("Entities.Contracts.School", "School")
                        .WithMany("Grades")
                        .HasForeignKey("SchoolId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("School");
                });

            modelBuilder.Entity("Entities.Contracts.KeyPoint", b =>
                {
                    b.HasOne("Entities.Contracts.Lesson", "Lesson")
                        .WithMany("KeyPoints")
                        .HasForeignKey("LessonID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Lesson");
                });

            modelBuilder.Entity("Entities.Contracts.Lesson", b =>
                {
                    b.HasOne("Entities.Contracts.Textbook", "Textbook")
                        .WithMany("Lessons")
                        .HasForeignKey("TextbookID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Textbook");
                });

            modelBuilder.Entity("Entities.Contracts.LessonQuestion", b =>
                {
                    b.HasOne("Entities.Contracts.Lesson", "Lesson")
                        .WithMany("LessonQuestions")
                        .HasForeignKey("LessonID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Lesson");
                });

            modelBuilder.Entity("Entities.Contracts.Question", b =>
                {
                    b.HasOne("Entities.Contracts.KeyPoint", "KeyPoint")
                        .WithMany("Questions")
                        .HasForeignKey("KeyPointId");

                    b.HasOne("Entities.Contracts.Lesson", "Lesson")
                        .WithMany("Questions")
                        .HasForeignKey("LessonId");

                    b.HasOne("Entities.Contracts.QuestionType", "QuestionType")
                        .WithMany("Questions")
                        .HasForeignKey("QuestioTypeId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.Subject", "Subject")
                        .WithMany("Questions")
                        .HasForeignKey("SubjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("KeyPoint");

                    b.Navigation("Lesson");

                    b.Navigation("QuestionType");

                    b.Navigation("Subject");
                });

            modelBuilder.Entity("Entities.Contracts.QuestionType", b =>
                {
                    b.HasOne("Entities.Contracts.Subject", "Subject")
                        .WithMany("QuestionTypes")
                        .HasForeignKey("SubjectId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Subject");
                });

            modelBuilder.Entity("Entities.Contracts.Submission", b =>
                {
                    b.HasOne("Entities.Contracts.Class", "Class")
                        .WithMany()
                        .HasForeignKey("ClassId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.Exam", "Exam")
                        .WithMany("Submissions")
                        .HasForeignKey("ExamId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.User", "Grader")
                        .WithMany("GradedSubmissions")
                        .HasForeignKey("GraderId");

                    b.HasOne("Entities.Contracts.User", "Student")
                        .WithMany("StudentSubmissions")
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Class");

                    b.Navigation("Exam");

                    b.Navigation("Grader");

                    b.Navigation("Student");
                });

            modelBuilder.Entity("Entities.Contracts.SubmissionDetail", b =>
                {
                    b.HasOne("Entities.Contracts.ExamQuestion", "ExamQuestion")
                        .WithMany("SubmissionDetails")
                        .HasForeignKey("ExamQuestionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.User", "Student")
                        .WithMany("SubmissionDetails")
                        .HasForeignKey("StudentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.Submission", "Submission")
                        .WithMany("SubmissionDetails")
                        .HasForeignKey("SubmissionId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("ExamQuestion");

                    b.Navigation("Student");

                    b.Navigation("Submission");
                });

            modelBuilder.Entity("Entities.Contracts.User", b =>
                {
                    b.HasOne("Entities.Contracts.Subject", "TeachSubject")
                        .WithMany("SubjectTeachers")
                        .HasForeignKey("TeachSubjectId");

                    b.Navigation("TeachSubject");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
                {
                    b.HasOne("Entities.Contracts.User", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
                {
                    b.HasOne("Entities.Contracts.User", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.User", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
                {
                    b.HasOne("Entities.Contracts.User", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Entities.Contracts.Class", b =>
                {
                    b.Navigation("ClassUsers");
                });

            modelBuilder.Entity("Entities.Contracts.Exam", b =>
                {
                    b.Navigation("ExamAttachments");

                    b.Navigation("Submissions");
                });

            modelBuilder.Entity("Entities.Contracts.ExamQuestion", b =>
                {
                    b.Navigation("ChildExamQuestions");

                    b.Navigation("Exam");

                    b.Navigation("SubmissionDetails");
                });

            modelBuilder.Entity("Entities.Contracts.ExamType", b =>
                {
                    b.Navigation("Exams");
                });

            modelBuilder.Entity("Entities.Contracts.Grade", b =>
                {
                    b.Navigation("Classes");
                });

            modelBuilder.Entity("Entities.Contracts.KeyPoint", b =>
                {
                    b.Navigation("Questions");
                });

            modelBuilder.Entity("Entities.Contracts.Lesson", b =>
                {
                    b.Navigation("KeyPoints");

                    b.Navigation("LessonQuestions");

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

            modelBuilder.Entity("Entities.Contracts.Question", b =>
                {
                    b.Navigation("ExamQuestions");
                });

            modelBuilder.Entity("Entities.Contracts.QuestionContext", b =>
                {
                    b.Navigation("Questions");
                });

            modelBuilder.Entity("Entities.Contracts.QuestionType", b =>
                {
                    b.Navigation("Questions");
                });

            modelBuilder.Entity("Entities.Contracts.School", b =>
                {
                    b.Navigation("Grades");
                });

            modelBuilder.Entity("Entities.Contracts.Subject", b =>
                {
                    b.Navigation("QuestionTypes");

                    b.Navigation("Questions");

                    b.Navigation("SubjectTeachers");
                });

            modelBuilder.Entity("Entities.Contracts.Submission", b =>
                {
                    b.Navigation("SubmissionDetails");
                });

            modelBuilder.Entity("Entities.Contracts.Textbook", b =>
                {
                    b.Navigation("Lessons");
                });

            modelBuilder.Entity("Entities.Contracts.User", b =>
                {
                    b.Navigation("CreatedExams");

                    b.Navigation("GradedSubmissions");

                    b.Navigation("StudentSubmissions");

                    b.Navigation("SubmissionDetails");

                    b.Navigation("UserInjoinedClass");
                });
#pragma warning restore 612, 618
        }
    }
}
