PIbd-21_MasenkinMS_Coursewo.../Hospital/HospitalDatabaseImplement/Migrations/HospitalDatabaseModelSnapshot.cs
2024-04-30 18:43:06 +04:00

400 lines
14 KiB
C#

// <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.13")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("HospitalDatabaseImplement.Models.Disease", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<int>("RecipeId")
.HasColumnType("int");
b.Property<string>("Symptoms")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.HasKey("Id");
b.HasIndex("RecipeId");
b.ToTable("Diseases");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.Doctor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<string>("FullName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<int>("Post")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Doctors");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.Medicine", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.HasKey("Id");
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<int>("DoctorId")
.HasColumnType("int");
b.Property<string>("FullName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Phone")
.IsRequired()
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.HasKey("Id");
b.HasIndex("DoctorId");
b.ToTable("Patients");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.PatientProcedure", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("PatientId")
.HasColumnType("int");
b.Property<int>("ProcedureId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("PatientId");
b.HasIndex("ProcedureId");
b.ToTable("PatientProcedures");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.PatientRecipe", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("PatientId")
.HasColumnType("int");
b.Property<int>("RecipeId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("PatientId");
b.HasIndex("RecipeId");
b.ToTable("PatientRecipes");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.Procedure", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Description")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
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>("DoctorId")
.HasColumnType("int");
b.Property<DateTime>("IssueDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DoctorId");
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.Disease", b =>
{
b.HasOne("HospitalDatabaseImplement.Models.Recipe", "Recipe")
.WithMany()
.HasForeignKey("RecipeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Recipe");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.Patient", b =>
{
b.HasOne("HospitalDatabaseImplement.Models.Doctor", "Doctor")
.WithMany()
.HasForeignKey("DoctorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Doctor");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.PatientProcedure", b =>
{
b.HasOne("HospitalDatabaseImplement.Models.Patient", "Patient")
.WithMany("Procedures")
.HasForeignKey("PatientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("HospitalDatabaseImplement.Models.Procedure", "Procedure")
.WithMany()
.HasForeignKey("ProcedureId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Patient");
b.Navigation("Procedure");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.PatientRecipe", b =>
{
b.HasOne("HospitalDatabaseImplement.Models.Patient", "Patient")
.WithMany("Recipes")
.HasForeignKey("PatientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("HospitalDatabaseImplement.Models.Recipe", "Recipe")
.WithMany()
.HasForeignKey("RecipeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Patient");
b.Navigation("Recipe");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.ProcedureMedicine", b =>
{
b.HasOne("HospitalDatabaseImplement.Models.Medicine", "Medicine")
.WithMany()
.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.Doctor", "Doctor")
.WithMany()
.HasForeignKey("DoctorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Doctor");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.RecipeMedicine", b =>
{
b.HasOne("HospitalDatabaseImplement.Models.Medicine", "Medicine")
.WithMany()
.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.Patient", b =>
{
b.Navigation("Procedures");
b.Navigation("Recipes");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.Procedure", b =>
{
b.Navigation("Medicines");
});
modelBuilder.Entity("HospitalDatabaseImplement.Models.Recipe", b =>
{
b.Navigation("Medicines");
});
#pragma warning restore 612, 618
}
}
}