// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using VetClinicContracts.ViewModels;

#nullable disable

namespace VetClinicDataBaseImplement.Migrations
{
    [DbContext(typeof(VetClinicDatabase))]
    partial class VetClinicDatabaseModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.4")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Admin", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("AdminFIO")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

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

                    b.HasKey("Id");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Animal", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

                    b.Property<string>("AnimalName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Family")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AdminId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Guidance", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<DateTime>("Date")
                        .HasColumnType("datetime2");

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

                    b.Property<string>("Text")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("ServiceId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Medicine", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("MedicineName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

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

                    b.Property<double>("Price")
                        .HasColumnType("float");

                    b.HasKey("Id");

                    b.HasIndex("PharmacistId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.MedicineAnimal", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("AnimalId");

                    b.HasIndex("MedicineId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Pharmacist", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

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

                    b.Property<string>("PharmacistFIO")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Service", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

                    b.Property<double>("Price")
                        .HasColumnType("float");

                    b.Property<string>("ServiceName")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("PharmacistId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.ServiceMedicine", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("MedicineId");

                    b.HasIndex("ServiceId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Vaccination", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

                    b.Property<double>("CostVaccination")
                        .HasColumnType("float");

                    b.Property<DateTime?>("DateStamp")
                        .IsRequired()
                        .HasColumnType("datetime2");

                    b.Property<string>("NameVaccination")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AnimalId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Visit", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

                    b.Property<DateTime>("DateVisit")
                        .HasColumnType("datetime2");

                    b.Property<string>("NameVisit")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.HasIndex("AdminId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.VisitAnimal", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("AnimalId");

                    b.HasIndex("VisitId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.VisitService", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

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

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

                    b.HasKey("Id");

                    b.HasIndex("ServiceId");

                    b.HasIndex("VisitId");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Animal", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Admin", "Admin")
                        .WithMany("Animals")
                        .HasForeignKey("AdminId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Guidance", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Service", "Service")
                        .WithMany("Guidances")
                        .HasForeignKey("ServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Medicine", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Pharmacist", "Pharmacist")
                        .WithMany("Medicines")
                        .HasForeignKey("PharmacistId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.MedicineAnimal", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Animal", "Animal")
                        .WithMany("Medicines")
                        .HasForeignKey("AnimalId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("VetClinicDataBaseImplement.Models.Medicine", "Medicine")
                        .WithMany("Animals")
                        .HasForeignKey("MedicineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Animal");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Service", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Pharmacist", "Pharmacist")
                        .WithMany("Services")
                        .HasForeignKey("PharmacistId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.ServiceMedicine", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Medicine", "Medicine")
                        .WithMany("Services")
                        .HasForeignKey("MedicineId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("VetClinicDataBaseImplement.Models.Service", "Service")
                        .WithMany("Medicines")
                        .HasForeignKey("ServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Medicine");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Vaccination", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Animal", "Animal")
                        .WithMany("Vaccinations")
                        .HasForeignKey("AnimalId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Visit", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Admin", "Admin")
                        .WithMany("Visits")
                        .HasForeignKey("AdminId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.VisitAnimal", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Animal", "Animal")
                        .WithMany("Visits")
                        .HasForeignKey("AnimalId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("VetClinicDataBaseImplement.Models.Visit", "Visit")
                        .WithMany("Animals")
                        .HasForeignKey("VisitId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Animal");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.VisitService", b =>
                {
                    b.HasOne("VetClinicDataBaseImplement.Models.Service", "Service")
                        .WithMany("Visits")
                        .HasForeignKey("ServiceId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("VetClinicDataBaseImplement.Models.Visit", "Visit")
                        .WithMany("Services")
                        .HasForeignKey("VisitId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Service");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Admin", b =>
                {
                    b.Navigation("Animals");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Animal", b =>
                {
                    b.Navigation("Medicines");

                    b.Navigation("Vaccinations");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Medicine", b =>
                {
                    b.Navigation("Animals");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Pharmacist", b =>
                {
                    b.Navigation("Medicines");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Service", b =>
                {
                    b.Navigation("Guidances");

                    b.Navigation("Medicines");

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

            modelBuilder.Entity("VetClinicDataBaseImplement.Models.Visit", b =>
                {
                    b.Navigation("Animals");

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