// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Posechaemost.Data.RemoteData.RemoteDataBase;

#nullable disable

namespace Posechaemost.Migrations
{
    [DbContext(typeof(RemoteDataBaseContext))]
    partial class RemoteDataBaseContextModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.10")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.Entity("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.GroupDao", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

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

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

                    b.HasKey("Id");

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

            modelBuilder.Entity("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.PresenceDao", b =>
                {
                    b.Property<int>("PresenceId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

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

                    b.Property<int>("ClassNumber")
                        .HasColumnType("integer");

                    b.Property<DateOnly>("Date")
                        .HasColumnType("date");

                    b.Property<int>("GroupId")
                        .HasColumnType("integer");

                    b.Property<bool>("IsAttendence")
                        .HasColumnType("boolean");

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

                    b.HasKey("PresenceId");

                    b.HasIndex("UserId");

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

            modelBuilder.Entity("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
                {
                    b.Property<int>("UserId")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

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

                    b.Property<string>("FIO")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("GroupId")
                        .HasColumnType("integer");

                    b.HasKey("UserId");

                    b.HasIndex("GroupId");

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

            modelBuilder.Entity("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.PresenceDao", b =>
                {
                    b.HasOne("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.UserDao", "User")
                        .WithMany("Presences")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
                {
                    b.HasOne("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.GroupDao", "Group")
                        .WithMany("User")
                        .HasForeignKey("GroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.GroupDao", b =>
                {
                    b.Navigation("User");
                });

            modelBuilder.Entity("Posechaemost.Data.RemoteData.RemoteDataBase.DAO.UserDao", b =>
                {
                    b.Navigation("Presences");
                });
#pragma warning restore 612, 618
        }
    }
}
