2023-04-05 18:55:35 +04:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using HospitalDatabaseImplement;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace HospitalDatabaseImplement.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(HospitalDatabase))]
|
|
|
|
|
partial class HospitalDatabaseModelSnapshot : ModelSnapshot
|
|
|
|
|
{
|
|
|
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
|
|
|
|
.HasAnnotation("ProductVersion", "7.0.4")
|
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
|
|
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Apothecary", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Login")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(50)
|
|
|
|
|
.HasColumnType("nvarchar(50)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Password")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(55)
|
|
|
|
|
.HasColumnType("nvarchar(55)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Apothecaries");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Medicine", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ApothecaryId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Cost")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Dose")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(10)
|
|
|
|
|
.HasColumnType("nvarchar(10)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(60)
|
|
|
|
|
.HasColumnType("nvarchar(60)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ApothecaryId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Medicines");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Patient", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("BirthDate")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Patronymic")
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Surname")
|
2023-04-06 13:31:20 +04:00
|
|
|
|
.IsRequired()
|
2023-04-05 18:55:35 +04:00
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("TreatmentId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("TreatmentId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Patients");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Prescription", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ApothecaryId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("Date")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("MedicineId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Number")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ApothecaryId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("MedicineId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Prescriptions");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Procedure", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(50)
|
|
|
|
|
.HasColumnType("nvarchar(50)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Procedures");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.ProcedureMedicine", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("MedicineId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ProcedureId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("MedicineId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProcedureId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("ProcedureMedicines");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Recipe", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ApothecaryId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("Date")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(50)
|
|
|
|
|
.HasColumnType("nvarchar(50)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ApothecaryId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Recipes");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.RecipeMedicine", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("MedicineId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("RecipeId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("MedicineId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("RecipeId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("RecipeMedicines");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.RecipeTreatment", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("RecipeId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("TreatmentId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("RecipeId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("TreatmentId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("RecipeTreatments");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Treatment", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasMaxLength(55)
|
|
|
|
|
.HasColumnType("nvarchar(55)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Treatments");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.TreatmentProcedure", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ProcedureId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("TreatmentId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProcedureId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("TreatmentId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("TreatmentProcedures");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Medicine", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Apothecary", "Apothecary")
|
2023-04-06 13:31:20 +04:00
|
|
|
|
.WithMany("Medicines")
|
2023-04-05 18:55:35 +04:00
|
|
|
|
.HasForeignKey("ApothecaryId")
|
2023-04-06 13:31:20 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Restrict)
|
2023-04-05 18:55:35 +04:00
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Apothecary");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Patient", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Treatment", "Treatment")
|
|
|
|
|
.WithMany("Patients")
|
|
|
|
|
.HasForeignKey("TreatmentId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Treatment");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Prescription", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Apothecary", "Apothecary")
|
2023-04-06 13:31:20 +04:00
|
|
|
|
.WithMany("Prescriptions")
|
2023-04-05 18:55:35 +04:00
|
|
|
|
.HasForeignKey("ApothecaryId")
|
2023-04-06 13:31:20 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Restrict)
|
2023-04-05 18:55:35 +04:00
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Medicine", "Medicine")
|
|
|
|
|
.WithMany("Prescriptions")
|
|
|
|
|
.HasForeignKey("MedicineId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Apothecary");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Medicine");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.ProcedureMedicine", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Medicine", "Medicine")
|
|
|
|
|
.WithMany("Procedures")
|
|
|
|
|
.HasForeignKey("MedicineId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Procedure", "Procedure")
|
|
|
|
|
.WithMany("Medicines")
|
|
|
|
|
.HasForeignKey("ProcedureId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Medicine");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Procedure");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Recipe", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Apothecary", "Apothecary")
|
2023-04-06 13:31:20 +04:00
|
|
|
|
.WithMany("Recipes")
|
2023-04-05 18:55:35 +04:00
|
|
|
|
.HasForeignKey("ApothecaryId")
|
2023-04-06 13:31:20 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Restrict)
|
2023-04-05 18:55:35 +04:00
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Apothecary");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.RecipeMedicine", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Medicine", "Medicine")
|
|
|
|
|
.WithMany("Recipes")
|
|
|
|
|
.HasForeignKey("MedicineId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Recipe", "Recipe")
|
|
|
|
|
.WithMany("Medicines")
|
|
|
|
|
.HasForeignKey("RecipeId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Medicine");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Recipe");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.RecipeTreatment", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Recipe", "Recipe")
|
|
|
|
|
.WithMany("Treatments")
|
|
|
|
|
.HasForeignKey("RecipeId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Treatment", "Treatment")
|
|
|
|
|
.WithMany("Recipes")
|
|
|
|
|
.HasForeignKey("TreatmentId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Recipe");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Treatment");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.TreatmentProcedure", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Procedure", "Procedure")
|
|
|
|
|
.WithMany("Treatments")
|
|
|
|
|
.HasForeignKey("ProcedureId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HospitalDatabaseImplement.Models.Treatment", "Treatment")
|
|
|
|
|
.WithMany("Procedures")
|
|
|
|
|
.HasForeignKey("TreatmentId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Procedure");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Treatment");
|
|
|
|
|
});
|
2023-04-06 13:31:20 +04:00
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Apothecary", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Medicines");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Prescriptions");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Recipes");
|
|
|
|
|
});
|
2023-04-05 18:55:35 +04:00
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Medicine", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Prescriptions");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Procedures");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Recipes");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Procedure", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Medicines");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Treatments");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Recipe", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Medicines");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Treatments");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HospitalDatabaseImplement.Models.Treatment", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Patients");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Procedures");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Recipes");
|
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|