// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using UniVerse.Infrastructure.Data;

#nullable disable

namespace UniVerse.Infrastructure.Migrations
{
    [DbContext(typeof(AppDbContext))]
    [Migration("20260521170452_ReviewPromptSettings")]
    partial class ReviewPromptSettings
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "10.0.7")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "coin_transaction_type", "coin_transaction_type", new[] { "review_reward", "achievement_reward", "attendance_reward", "admin_adjustment" });
            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "review_llm_status", "review_llm_status", new[] { "pending", "analyzed", "rejected" });
            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "review_sentiment", "review_sentiment", new[] { "positive", "neutral", "negative" });
            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "tag_type", "tag_type", new[] { "institute", "faculty", "subject", "organization", "topic", "other" });
            NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "user_role", "user_role", new[] { "student", "teacher", "admin" });
            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("UniVerse.Domain.Entities.Achievement", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<int>("CoinReward")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0)
                        .HasColumnName("coin_reward");

                    b.Property<string>("Condition")
                        .HasColumnType("text")
                        .HasColumnName("condition");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

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

                    b.Property<string>("IconUrl")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("icon_url");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.Property<int>("XpReward")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0)
                        .HasColumnName("xp_reward");

                    b.HasKey("Id");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.CoinTransaction", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<int?>("AchievementId")
                        .HasColumnType("integer")
                        .HasColumnName("achievement_id");

                    b.Property<int>("Amount")
                        .HasColumnType("integer")
                        .HasColumnName("amount");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<string>("Description")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("description");

                    b.Property<int?>("ReviewId")
                        .HasColumnType("integer")
                        .HasColumnName("review_id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.HasKey("Id");

                    b.HasIndex("AchievementId");

                    b.HasIndex("ReviewId");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Course", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

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

                    b.Property<string>("ExternalId")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("external_id");

                    b.Property<bool>("IsSynced")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_synced");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("name");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("NOW()");

                    b.HasKey("Id");

                    b.HasIndex("ExternalId")
                        .IsUnique()
                        .HasFilter("external_id IS NOT NULL");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.CourseTag", b =>
                {
                    b.Property<int>("CourseId")
                        .HasColumnType("integer")
                        .HasColumnName("course_id");

                    b.Property<int>("TagId")
                        .HasColumnType("integer")
                        .HasColumnName("tag_id");

                    b.Property<int>("Id")
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    b.HasKey("CourseId", "TagId");

                    b.HasIndex("TagId");

                    b.HasIndex("CourseId", "TagId")
                        .IsUnique();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Lecture", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<int>("CourseId")
                        .HasColumnType("integer")
                        .HasColumnName("course_id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

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

                    b.Property<DateTime>("EndsAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("ends_at");

                    b.Property<string>("ExternalId")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("external_id");

                    b.Property<int>("Format")
                        .HasColumnType("integer")
                        .HasColumnName("format");

                    b.Property<bool>("IsOpen")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("is_open");

                    b.Property<int?>("LocationId")
                        .HasColumnType("integer")
                        .HasColumnName("location_id");

                    b.Property<int>("MaxEnrollments")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0)
                        .HasColumnName("max_enrollments");

                    b.Property<string>("OnlineUrl")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("online_url");

                    b.Property<DateTime>("StartsAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("starts_at");

                    b.Property<int?>("TeacherId")
                        .HasColumnType("integer")
                        .HasColumnName("teacher_id");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("title");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("NOW()");

                    b.HasKey("Id");

                    b.HasIndex("CourseId");

                    b.HasIndex("ExternalId")
                        .IsUnique()
                        .HasFilter("external_id IS NOT NULL");

                    b.HasIndex("LocationId");

                    b.HasIndex("StartsAt");

                    b.HasIndex("TeacherId");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.LectureEnrollment", b =>
                {
                    b.Property<int>("LectureId")
                        .HasColumnType("integer")
                        .HasColumnName("lecture_id");

                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.Property<bool>("Attended")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("attended");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<int>("Id")
                        .HasColumnType("integer")
                        .HasColumnName("id");

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

                    b.HasIndex("UserId");

                    b.HasIndex("LectureId", "UserId")
                        .IsUnique();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.LevelThreshold", b =>
                {
                    b.Property<int>("Level")
                        .HasColumnType("integer")
                        .HasColumnName("level");

                    b.Property<int>("RequiredXp")
                        .HasColumnType("integer")
                        .HasColumnName("required_xp");

                    b.HasKey("Level");

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

                    b.ToTable("level_thresholds", null, t =>
                        {
                            t.HasCheckConstraint("CK_level_thresholds_level_positive", "level > 0");

                            t.HasCheckConstraint("CK_level_thresholds_required_xp_non_negative", "required_xp >= 0");
                        });

                    b.HasData(
                        new
                        {
                            Level = 1,
                            RequiredXp = 0
                        },
                        new
                        {
                            Level = 2,
                            RequiredXp = 100
                        },
                        new
                        {
                            Level = 3,
                            RequiredXp = 300
                        },
                        new
                        {
                            Level = 4,
                            RequiredXp = 600
                        },
                        new
                        {
                            Level = 5,
                            RequiredXp = 1000
                        },
                        new
                        {
                            Level = 6,
                            RequiredXp = 1500
                        },
                        new
                        {
                            Level = 7,
                            RequiredXp = 2500
                        },
                        new
                        {
                            Level = 8,
                            RequiredXp = 4000
                        });
                });

            modelBuilder.Entity("UniVerse.Domain.Entities.Location", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Address")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("address");

                    b.Property<string>("Building")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("building");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<string>("ExternalId")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("external_id");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.Property<string>("Room")
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)")
                        .HasColumnName("room");

                    b.HasKey("Id");

                    b.HasIndex("ExternalId")
                        .IsUnique()
                        .HasFilter("external_id IS NOT NULL");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.RefreshToken", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<DateTime>("ExpiresAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("expires_at");

                    b.Property<DateTime?>("RevokedAt")
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("revoked_at");

                    b.Property<string>("Token")
                        .IsRequired()
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("token");

                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.HasKey("Id");

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

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Review", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<bool?>("IsInformative")
                        .HasColumnType("boolean")
                        .HasColumnName("is_informative");

                    b.Property<int>("LectureId")
                        .HasColumnType("integer")
                        .HasColumnName("lecture_id");

                    b.Property<int>("LlmStatus")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0)
                        .HasColumnName("llm_status");

                    b.PrimitiveCollection<string[]>("LlmTags")
                        .HasColumnType("text[]")
                        .HasColumnName("llm_tags");

                    b.Property<double?>("QualityScore")
                        .HasColumnType("double precision")
                        .HasColumnName("quality_score");

                    b.Property<int>("Rating")
                        .HasColumnType("integer")
                        .HasColumnName("rating");

                    b.Property<int?>("Sentiment")
                        .HasColumnType("integer")
                        .HasColumnName("sentiment");

                    b.Property<string>("Text")
                        .HasColumnType("text")
                        .HasColumnName("text");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.HasKey("Id");

                    b.HasIndex("LlmStatus");

                    b.HasIndex("UserId");

                    b.HasIndex("LectureId", "UserId")
                        .IsUnique();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.ReviewPromptSetting", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<string>("Prompt")
                        .IsRequired()
                        .HasColumnType("text")
                        .HasColumnName("prompt");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("NOW()");

                    b.HasKey("Id");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.StudentProfile", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<int?>("EnrollmentYear")
                        .HasColumnType("integer")
                        .HasColumnName("enrollment_year");

                    b.Property<string>("Faculty")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("faculty");

                    b.Property<string>("GroupName")
                        .HasMaxLength(100)
                        .HasColumnType("character varying(100)")
                        .HasColumnName("group_name");

                    b.Property<string>("Specialty")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("specialty");

                    b.Property<string>("StudentId")
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasColumnName("student_id");

                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Tag", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("name");

                    b.Property<int?>("ParentId")
                        .HasColumnType("integer")
                        .HasColumnName("parent_id");

                    b.Property<int>("Type")
                        .HasColumnType("integer")
                        .HasColumnName("type");

                    b.HasKey("Id");

                    b.HasIndex("ParentId");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.TeacherProfile", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Bio")
                        .HasColumnType("text")
                        .HasColumnName("bio");

                    b.Property<string>("Department")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("department");

                    b.Property<string>("ModeusId")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("modeus_id");

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

                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.HasKey("Id");

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

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

            modelBuilder.Entity("UniVerse.Domain.Entities.User", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("AvatarUrl")
                        .HasMaxLength(500)
                        .HasColumnType("character varying(500)")
                        .HasColumnName("avatar_url");

                    b.Property<int>("Coins")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0)
                        .HasColumnName("coins");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<string>("DisplayName")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("display_name");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("email");

                    b.Property<bool>("IsActive")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(true)
                        .HasColumnName("is_active");

                    b.Property<string>("MicrosoftId")
                        .HasMaxLength(255)
                        .HasColumnType("character varying(255)")
                        .HasColumnName("microsoft_id");

                    b.Property<DateTime>("UpdatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("updated_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<int>("Xp")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasDefaultValue(0)
                        .HasColumnName("xp");

                    b.HasKey("Id");

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

                    b.HasIndex("MicrosoftId")
                        .IsUnique()
                        .HasFilter("microsoft_id IS NOT NULL");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.UserAchievement", b =>
                {
                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.Property<int>("AchievementId")
                        .HasColumnType("integer")
                        .HasColumnName("achievement_id");

                    b.Property<DateTime>("AwardedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("awarded_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<int>("Id")
                        .HasColumnType("integer")
                        .HasColumnName("id");

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

                    b.HasIndex("AchievementId");

                    b.HasIndex("UserId", "AchievementId")
                        .IsUnique();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.UserNotification", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasColumnName("id");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<string>("Body")
                        .IsRequired()
                        .HasMaxLength(1000)
                        .HasColumnType("character varying(1000)")
                        .HasColumnName("body");

                    b.Property<DateTime>("CreatedAt")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("timestamp with time zone")
                        .HasColumnName("created_at")
                        .HasDefaultValueSql("NOW()");

                    b.Property<bool>("IsRead")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("boolean")
                        .HasDefaultValue(false)
                        .HasColumnName("is_read");

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

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(50)
                        .HasColumnType("character varying(50)")
                        .HasColumnName("type");

                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.HasKey("Id");

                    b.HasIndex("UserId", "CreatedAt");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.UserRoleAssignment", b =>
                {
                    b.Property<int>("UserId")
                        .HasColumnType("integer")
                        .HasColumnName("user_id");

                    b.Property<int>("Role")
                        .HasColumnType("integer")
                        .HasColumnName("role");

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

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

            modelBuilder.Entity("UniVerse.Domain.Entities.CoinTransaction", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.Achievement", "Achievement")
                        .WithMany()
                        .HasForeignKey("AchievementId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("UniVerse.Domain.Entities.Review", "Review")
                        .WithMany("CoinTransactions")
                        .HasForeignKey("ReviewId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithMany("CoinTransactions")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Achievement");

                    b.Navigation("Review");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.CourseTag", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.Course", "Course")
                        .WithMany("CourseTags")
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("UniVerse.Domain.Entities.Tag", "Tag")
                        .WithMany("CourseTags")
                        .HasForeignKey("TagId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Course");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Lecture", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.Course", "Course")
                        .WithMany("Lectures")
                        .HasForeignKey("CourseId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("UniVerse.Domain.Entities.Location", "Location")
                        .WithMany("Lectures")
                        .HasForeignKey("LocationId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.HasOne("UniVerse.Domain.Entities.User", "Teacher")
                        .WithMany()
                        .HasForeignKey("TeacherId")
                        .OnDelete(DeleteBehavior.SetNull);

                    b.Navigation("Course");

                    b.Navigation("Location");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.LectureEnrollment", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.Lecture", "Lecture")
                        .WithMany("Enrollments")
                        .HasForeignKey("LectureId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithMany("Enrollments")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Lecture");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.RefreshToken", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithMany("RefreshTokens")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Review", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.Lecture", "Lecture")
                        .WithMany("Reviews")
                        .HasForeignKey("LectureId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithMany("Reviews")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Lecture");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.StudentProfile", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithOne("StudentProfile")
                        .HasForeignKey("UniVerse.Domain.Entities.StudentProfile", "UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Tag", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.Tag", "Parent")
                        .WithMany("Children")
                        .HasForeignKey("ParentId")
                        .OnDelete(DeleteBehavior.SetNull);

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

            modelBuilder.Entity("UniVerse.Domain.Entities.TeacherProfile", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithOne("TeacherProfile")
                        .HasForeignKey("UniVerse.Domain.Entities.TeacherProfile", "UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.UserAchievement", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.Achievement", "Achievement")
                        .WithMany("UserAchievements")
                        .HasForeignKey("AchievementId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithMany("UserAchievements")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Achievement");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.UserNotification", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithMany("Notifications")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.UserRoleAssignment", b =>
                {
                    b.HasOne("UniVerse.Domain.Entities.User", "User")
                        .WithMany("Roles")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Achievement", b =>
                {
                    b.Navigation("UserAchievements");
                });

            modelBuilder.Entity("UniVerse.Domain.Entities.Course", b =>
                {
                    b.Navigation("CourseTags");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Lecture", b =>
                {
                    b.Navigation("Enrollments");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.Location", b =>
                {
                    b.Navigation("Lectures");
                });

            modelBuilder.Entity("UniVerse.Domain.Entities.Review", b =>
                {
                    b.Navigation("CoinTransactions");
                });

            modelBuilder.Entity("UniVerse.Domain.Entities.Tag", b =>
                {
                    b.Navigation("Children");

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

            modelBuilder.Entity("UniVerse.Domain.Entities.User", b =>
                {
                    b.Navigation("CoinTransactions");

                    b.Navigation("Enrollments");

                    b.Navigation("Notifications");

                    b.Navigation("RefreshTokens");

                    b.Navigation("Reviews");

                    b.Navigation("Roles");

                    b.Navigation("StudentProfile");

                    b.Navigation("TeacherProfile");

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