//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using VeterinaryClinicDatabaseImplement;
#nullable disable
namespace VeterinaryClinicDatabaseImplement.Migrations
{
[DbContext(typeof(VeterinaryClinicDatabase))]
partial class VeterinaryClinicDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Animal", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Age")
.HasColumnType("integer");
b.Property("Breed")
.IsRequired()
.HasColumnType("text");
b.Property("Type")
.IsRequired()
.HasColumnType("text");
b.Property("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Animals");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.AnimalMedication", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AnimalId")
.HasColumnType("integer");
b.Property("MedicationId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AnimalId");
b.HasIndex("MedicationId");
b.ToTable("AnimalMedications");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Medication", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.IsRequired()
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Medications");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Service", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Cost")
.HasColumnType("integer");
b.Property("MedicationId")
.HasColumnType("integer");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("MedicationId");
b.ToTable("Services");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Email")
.IsRequired()
.HasColumnType("text");
b.Property("FullName")
.IsRequired()
.HasColumnType("text");
b.Property("Password")
.IsRequired()
.HasColumnType("text");
b.Property("Phone")
.IsRequired()
.HasColumnType("text");
b.Property("Role")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Vaccination", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AnimalId")
.HasColumnType("integer");
b.Property("DateInjection")
.HasColumnType("timestamp without time zone");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("UserId")
.HasColumnType("integer");
b.Property("ValidityPeriod")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AnimalId");
b.HasIndex("UserId");
b.ToTable("Vaccinations");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Visit", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Date")
.HasColumnType("timestamp without time zone");
b.Property("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Visits");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.VisitAnimal", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("AnimalId")
.HasColumnType("integer");
b.Property("VisitId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AnimalId");
b.HasIndex("VisitId");
b.ToTable("VisitAnimals");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.VisitService", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("ServiceId")
.HasColumnType("integer");
b.Property("VisitId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ServiceId");
b.HasIndex("VisitId");
b.ToTable("VisitServices");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Animal", b =>
{
b.HasOne("VeterinaryClinicDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.AnimalMedication", b =>
{
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Animal", "Animal")
.WithMany("Medications")
.HasForeignKey("AnimalId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Medication", "Medication")
.WithMany()
.HasForeignKey("MedicationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Animal");
b.Navigation("Medication");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Service", b =>
{
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Medication", "Medication")
.WithMany()
.HasForeignKey("MedicationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Medication");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Vaccination", b =>
{
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Animal", "Animal")
.WithMany()
.HasForeignKey("AnimalId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("VeterinaryClinicDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Animal");
b.Navigation("User");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Visit", b =>
{
b.HasOne("VeterinaryClinicDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.VisitAnimal", b =>
{
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Animal", "Animal")
.WithMany()
.HasForeignKey("AnimalId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Visit", "Visit")
.WithMany("Animals")
.HasForeignKey("VisitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Animal");
b.Navigation("Visit");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.VisitService", b =>
{
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Service", "Service")
.WithMany()
.HasForeignKey("ServiceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("VeterinaryClinicDatabaseImplement.Models.Visit", "Visit")
.WithMany("Services")
.HasForeignKey("VisitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Service");
b.Navigation("Visit");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Animal", b =>
{
b.Navigation("Medications");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Visit", b =>
{
b.Navigation("Animals");
b.Navigation("Services");
});
#pragma warning restore 612, 618
}
}
}