// <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("20250905101308_tee")]
    partial class tee
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.16")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);

            modelBuilder.Entity("Entities.Contracts.Assignment", 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<byte>("ExamType")
                        .HasColumnType("tinyint unsigned");

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

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

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

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

                    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.Property<Guid?>("UserId")
                        .HasColumnType("char(36)");

                    b.HasKey("Id");

                    b.HasIndex("CreatorId");

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

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Entities.Contracts.AssignmentAttachment", 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.AssignmentClass", b =>
                {
                    b.Property<Guid>("AssignmentId")
                        .HasColumnType("char(36)")
                        .HasColumnName("assignment_id")
                        .HasColumnOrder(0);

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

                    b.Property<DateTime>("AssignedAt")
                        .HasColumnType("datetime(6)")
                        .HasColumnName("assigned_at");

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

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

                    b.HasIndex("ClassId");

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

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

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

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

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

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

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

                    b.Property<Guid?>("ParentAssignmentQuestionId")
                        .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<float?>("Score")
                        .HasColumnType("float")
                        .HasColumnName("score");

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

                    b.Property<byte>("StructType")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("group_state");

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

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

                    b.HasKey("Id");

                    b.HasIndex("AssignmentId");

                    b.HasIndex("ParentAssignmentQuestionId");

                    b.HasIndex("QuestionContextId");

                    b.HasIndex("QuestionId");

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

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

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

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<DateTime>("CreatedAt"));

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

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

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

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

                    b.Property<byte>("Number")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("class");

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

                    MySqlPropertyBuilderExtensions.UseMySqlComputedColumn(b.Property<DateTime>("UpdatedAt"));

                    b.HasKey("Id");

                    b.HasIndex("HeadTeacherId");

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

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

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

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

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

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

                    b.HasIndex("StudentId");

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

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

                    b.Property<Guid>("TeacherId")
                        .HasColumnType("char(36)")
                        .HasColumnName("teacher_id");

                    b.Property<byte>("SubjectTaught")
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("subject_taught");

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

                    b.HasIndex("TeacherId");

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

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

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

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

                    b.HasKey("Id");

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

            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("correct_answer");

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

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<DateTime>("CreatedAt"));

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

                    b.Property<byte>("DifficultyLevel")
                        .HasMaxLength(10)
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("difficulty_level");

                    b.Property<bool>("IsDeleted")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("tinyint(1)")
                        .HasDefaultValue(false)
                        .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<string>("QType")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<byte>("SubjectArea")
                        .HasMaxLength(100)
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("subject_area");

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

                    b.Property<byte>("Type")
                        .HasMaxLength(20)
                        .HasColumnType("tinyint unsigned")
                        .HasColumnName("question_type");

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

                    b.HasKey("Id");

                    b.HasIndex("CreatorId");

                    b.HasIndex("KeyPointId");

                    b.HasIndex("LessonId");

                    b.HasIndex("Title")
                        .HasAnnotation("MySql:IndexPrefixLength", new[] { 20 });

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

            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.Submission", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("char(36)")
                        .HasColumnName("id");

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

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

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

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

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

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

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

                    b.Property<float>("OverallGrade")
                        .HasPrecision(5, 2)
                        .HasColumnType("float")
                        .HasColumnName("overall_grade");

                    b.Property<int>("Status")
                        .HasMaxLength(15)
                        .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("AssignmentId");

                    b.HasIndex("GraderId");

                    b.HasIndex("StudentId");

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

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

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

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

                    MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<DateTime>("CreatedAt"));

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

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

                    b.Property<float?>("PointsAwarded")
                        .HasPrecision(5, 2)
                        .HasColumnType("float")
                        .HasColumnName("points_awarded");

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

                    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")
                        .IsConcurrencyToken()
                        .ValueGeneratedOnAddOrUpdate()
                        .HasColumnType("datetime(6)")
                        .HasColumnName("updated_at");

                    b.HasKey("Id");

                    b.HasIndex("AssignmentQuestionId");

                    b.HasIndex("StudentId");

                    b.HasIndex("SubmissionId");

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

            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>("Address")
                        .HasColumnType("longtext");

                    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<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<string>("SecurityStamp")
                        .HasColumnType("longtext");

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

                    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.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);

                    b.HasData(
                        new
                        {
                            Id = new Guid("d480cdca-7de2-4abe-8129-73bbaa6c1b32"),
                            Name = "Student",
                            NormalizedName = "STUDENT"
                        },
                        new
                        {
                            Id = new Guid("d7bcfb37-3f1c-467b-a3f0-b2339a8a990d"),
                            Name = "Teacher",
                            NormalizedName = "TEACHER"
                        },
                        new
                        {
                            Id = new Guid("f4a6788a-04d8-499c-9e64-73dfba97ca6b"),
                            Name = "Administrator",
                            NormalizedName = "ADMINISTRATOR"
                        });
                });

            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.Assignment", b =>
                {
                    b.HasOne("Entities.Contracts.User", "Creator")
                        .WithMany()
                        .HasForeignKey("CreatorId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

                    b.HasOne("Entities.Contracts.User", null)
                        .WithMany("CreatedAssignments")
                        .HasForeignKey("UserId");

                    b.Navigation("Creator");

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

            modelBuilder.Entity("Entities.Contracts.AssignmentAttachment", b =>
                {
                    b.HasOne("Entities.Contracts.Assignment", "Assignment")
                        .WithMany("AssignmentAttachments")
                        .HasForeignKey("AssignmentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Entities.Contracts.AssignmentClass", b =>
                {
                    b.HasOne("Entities.Contracts.Assignment", "Assignment")
                        .WithMany("AssignmentClasses")
                        .HasForeignKey("AssignmentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.Class", "Class")
                        .WithMany("AssignmentClasses")
                        .HasForeignKey("ClassId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Assignment");

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

            modelBuilder.Entity("Entities.Contracts.AssignmentQuestion", b =>
                {
                    b.HasOne("Entities.Contracts.Assignment", "Assignment")
                        .WithMany()
                        .HasForeignKey("AssignmentId");

                    b.HasOne("Entities.Contracts.AssignmentQuestion", "ParentAssignmentQuestion")
                        .WithMany("ChildrenAssignmentQuestion")
                        .HasForeignKey("ParentAssignmentQuestionId")
                        .OnDelete(DeleteBehavior.Cascade);

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

                    b.HasOne("Entities.Contracts.Question", "Question")
                        .WithMany("AssignmentQuestions")
                        .HasForeignKey("QuestionId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.Navigation("Assignment");

                    b.Navigation("ParentAssignmentQuestion");

                    b.Navigation("Question");

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

            modelBuilder.Entity("Entities.Contracts.Class", b =>
                {
                    b.HasOne("Entities.Contracts.User", "HeadTeacher")
                        .WithMany()
                        .HasForeignKey("HeadTeacherId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

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

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

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

                    b.Navigation("Class");

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

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

                    b.HasOne("Entities.Contracts.User", "Teacher")
                        .WithMany("TaughtClassesLink")
                        .HasForeignKey("TeacherId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Class");

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

            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.User", "Creator")
                        .WithMany("CreatedQuestions")
                        .HasForeignKey("CreatorId")
                        .OnDelete(DeleteBehavior.Restrict)
                        .IsRequired();

                    b.HasOne("Entities.Contracts.KeyPoint", "KeyPoint")
                        .WithMany("Questions")
                        .HasForeignKey("KeyPointId")
                        .OnDelete(DeleteBehavior.SetNull);

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

                    b.Navigation("Creator");

                    b.Navigation("KeyPoint");

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

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

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

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

                    b.Navigation("Assignment");

                    b.Navigation("Grader");

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

            modelBuilder.Entity("Entities.Contracts.SubmissionDetail", b =>
                {
                    b.HasOne("Entities.Contracts.AssignmentQuestion", "AssignmentQuestion")
                        .WithMany("SubmissionDetails")
                        .HasForeignKey("AssignmentQuestionId")
                        .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("AssignmentQuestion");

                    b.Navigation("Student");

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

            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.Assignment", b =>
                {
                    b.Navigation("AssignmentAttachments");

                    b.Navigation("AssignmentClasses");

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

            modelBuilder.Entity("Entities.Contracts.AssignmentQuestion", b =>
                {
                    b.Navigation("ChildrenAssignmentQuestion");

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

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

                    b.Navigation("ClassStudents");

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

            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("AssignmentQuestions");
                });

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

            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("CreatedAssignments");

                    b.Navigation("CreatedQuestions");

                    b.Navigation("EnrolledClassesLink");

                    b.Navigation("GradedSubmissions");

                    b.Navigation("SubmissionDetails");

                    b.Navigation("SubmissionsAsStudent");

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