// <auto-generated />
using System;
using DbConnectionLibrairie;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace DbConnectionLibrairie.Migrations
{
    [DbContext(typeof(MyDbContext))]
    partial class MyDbContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "8.0.2");

            modelBuilder.Entity("Entities.AdministratorEntity", b =>
                {
                    b.Property<uint>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("HashedPassword")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Username")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.AnswerEntity", b =>
                {
                    b.Property<uint>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<uint?>("IdQuestion")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("IdQuestion");

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

            modelBuilder.Entity("Entities.ChapterEntity", b =>
                {
                    b.Property<uint>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

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

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.LobbyEntity", b =>
                {
                    b.Property<uint>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<uint?>("IdCreator")
                        .HasColumnType("INTEGER");

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

                    b.Property<uint>("NbPlayers")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Password")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("IdCreator");

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

            modelBuilder.Entity("Entities.LobbyEntityPlayerEntity", b =>
                {
                    b.Property<uint>("IdLobby")
                        .HasColumnType("INTEGER");

                    b.Property<uint>("IdPlayer")
                        .HasColumnType("INTEGER");

                    b.Property<uint>("MaxScore")
                        .HasColumnType("INTEGER");

                    b.HasKey("IdLobby", "IdPlayer");

                    b.HasIndex("IdPlayer");

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

            modelBuilder.Entity("Entities.PlayerEntity", b =>
                {
                    b.Property<uint>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("HashedPassword")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<string>("Nickname")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

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

            modelBuilder.Entity("Entities.PlayerEntityChapterEntity", b =>
                {
                    b.Property<uint>("IdPlayer")
                        .HasColumnType("INTEGER");

                    b.Property<uint>("IdChapter")
                        .HasColumnType("INTEGER");

                    b.Property<uint>("MaxScore")
                        .HasColumnType("INTEGER");

                    b.HasKey("IdPlayer", "IdChapter");

                    b.HasIndex("IdChapter");

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

            modelBuilder.Entity("Entities.QuestionEntity", b =>
                {
                    b.Property<uint>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.Property<byte>("Difficulty")
                        .HasColumnType("INTEGER");

                    b.Property<uint?>("IdAnswerGood")
                        .HasColumnType("INTEGER");

                    b.Property<uint?>("IdChapter")
                        .HasColumnType("INTEGER");

                    b.Property<uint>("NbFalls")
                        .HasColumnType("INTEGER");

                    b.HasKey("Id");

                    b.HasIndex("IdAnswerGood");

                    b.HasIndex("IdChapter");

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

            modelBuilder.Entity("Entities.AnswerEntity", b =>
                {
                    b.HasOne("Entities.QuestionEntity", "Question")
                        .WithMany()
                        .HasForeignKey("IdQuestion");

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

            modelBuilder.Entity("Entities.LobbyEntity", b =>
                {
                    b.HasOne("Entities.PlayerEntity", "Creator")
                        .WithMany()
                        .HasForeignKey("IdCreator");

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

            modelBuilder.Entity("Entities.LobbyEntityPlayerEntity", b =>
                {
                    b.HasOne("Entities.LobbyEntity", "Lobby")
                        .WithMany()
                        .HasForeignKey("IdLobby")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.PlayerEntity", "Player")
                        .WithMany()
                        .HasForeignKey("IdPlayer")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Lobby");

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

            modelBuilder.Entity("Entities.PlayerEntityChapterEntity", b =>
                {
                    b.HasOne("Entities.ChapterEntity", "Chapter")
                        .WithMany()
                        .HasForeignKey("IdChapter")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Entities.PlayerEntity", "Player")
                        .WithMany()
                        .HasForeignKey("IdPlayer")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Chapter");

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

            modelBuilder.Entity("Entities.QuestionEntity", b =>
                {
                    b.HasOne("Entities.AnswerEntity", "AnswerGood")
                        .WithMany()
                        .HasForeignKey("IdAnswerGood");

                    b.HasOne("Entities.ChapterEntity", "Chapter")
                        .WithMany()
                        .HasForeignKey("IdChapter");

                    b.Navigation("AnswerGood");

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