PIbd-21_Danilov_V.V._Course.../VeterinaryClinic/VeterinaryClinicDatabaseImplement/Migrations/VeterinaryClinicDatabaseModelSnapshot.cs
2024-04-30 23:33:48 +04:00

380 lines
13 KiB
C#

// <auto-generated />
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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("Age")
.HasColumnType("integer");
b.Property<string>("Breed")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Animals");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.AnimalMedication", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AnimalId")
.HasColumnType("integer");
b.Property<int>("MedicationId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AnimalId");
b.HasIndex("MedicationId");
b.ToTable("AnimalMedications");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Medication", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Medications");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Service", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("Cost")
.HasColumnType("integer");
b.Property<int>("MedicationId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("MedicationId");
b.ToTable("Services");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Role")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Vaccination", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AnimalId")
.HasColumnType("integer");
b.Property<DateTime>("DateInjection")
.HasColumnType("timestamp without time zone");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<string>("ValidityPeriod")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("AnimalId");
b.HasIndex("UserId");
b.ToTable("Vaccinations");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.Visit", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("Date")
.HasColumnType("timestamp without time zone");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Visits");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.VisitAnimal", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AnimalId")
.HasColumnType("integer");
b.Property<int>("VisitId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("AnimalId");
b.HasIndex("VisitId");
b.ToTable("VisitAnimals");
});
modelBuilder.Entity("VeterinaryClinicDatabaseImplement.Models.VisitService", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("ServiceId")
.HasColumnType("integer");
b.Property<int>("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
}
}
}