Browse Source

随访表

master
wxd 1 year ago
parent
commit
c948554439
  1. 13
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/PhoneFollows/PhoneFollowDbMapping.cs
  2. 15625
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240918095223_update_follow_up.Designer.cs
  3. 87
      src/Shentun.Peis.EntityFrameworkCore/Migrations/20240918095223_update_follow_up.cs
  4. 27
      src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

13
src/Shentun.Peis.EntityFrameworkCore/DbMapping/PhoneFollows/PhoneFollowDbMapping.cs

@ -15,7 +15,7 @@ namespace Shentun.Peis.DbMapping
public void Configure(EntityTypeBuilder<PhoneFollowUp> entity) public void Configure(EntityTypeBuilder<PhoneFollowUp> entity)
{ {
entity.HasComment("电话随访"); entity.HasComment("电话随访");
entity.Property(t => t.PatientRegisterId).HasComment("病人登记ID").IsRequired();
//entity.Property(t => t.PatientRegisterId).HasComment("病人登记ID").IsRequired();
entity.Property(t => t.FollowUpContent).HasComment("随访内容"); entity.Property(t => t.FollowUpContent).HasComment("随访内容");
entity.Property(t => t.ReplyContent).HasComment("回复内容"); entity.Property(t => t.ReplyContent).HasComment("回复内容");
//entity.Property(t => t.FollowUpPlanId).HasComment("随访计划ID"); //entity.Property(t => t.FollowUpPlanId).HasComment("随访计划ID");
@ -27,11 +27,12 @@ namespace Shentun.Peis.DbMapping
//entity.Property(e => e.LastModificationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)"); //entity.Property(e => e.LastModificationTime).HasDefaultValueSql("(date(timezone('UTC-8'::text, now())) - 1)");
entity.HasOne(d => d.PatientRegister)
.WithMany(p => p.PhoneFollows)
.HasForeignKey(d => d.PatientRegisterId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("fk_phone_f");
entity.HasOne(d => d.FollowUp)
.WithMany(p => p.PhoneFollowUps)
.HasForeignKey(d => d.FollowUpId)
.HasConstraintName("fk_phone_follow_follow_up");
entity.ConfigureByConvention(); entity.ConfigureByConvention();
} }

15625
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240918095223_update_follow_up.Designer.cs
File diff suppressed because it is too large
View File

87
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240918095223_update_follow_up.cs

@ -0,0 +1,87 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Shentun.Peis.Migrations
{
public partial class update_follow_up : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_phone_f",
table: "phone_follow_up");
migrationBuilder.DropIndex(
name: "IX_phone_follow_up_patient_register_id",
table: "phone_follow_up");
migrationBuilder.DropColumn(
name: "patient_register_id",
table: "phone_follow_up");
migrationBuilder.AlterColumn<Guid>(
name: "follow_up_id",
table: "phone_follow_up",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uuid",
oldNullable: true);
migrationBuilder.CreateIndex(
name: "IX_phone_follow_up_follow_up_id",
table: "phone_follow_up",
column: "follow_up_id");
migrationBuilder.AddForeignKey(
name: "fk_phone_follow_follow_up",
table: "phone_follow_up",
column: "follow_up_id",
principalTable: "follow_up",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_phone_follow_follow_up",
table: "phone_follow_up");
migrationBuilder.DropIndex(
name: "IX_phone_follow_up_follow_up_id",
table: "phone_follow_up");
migrationBuilder.AlterColumn<Guid>(
name: "follow_up_id",
table: "phone_follow_up",
type: "uuid",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AddColumn<Guid>(
name: "patient_register_id",
table: "phone_follow_up",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
comment: "病人登记ID");
migrationBuilder.CreateIndex(
name: "IX_phone_follow_up_patient_register_id",
table: "phone_follow_up",
column: "patient_register_id");
migrationBuilder.AddForeignKey(
name: "fk_phone_f",
table: "phone_follow_up",
column: "patient_register_id",
principalTable: "patient_register",
principalColumn: "id");
}
}
}

27
src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs

@ -7841,7 +7841,7 @@ namespace Shentun.Peis.Migrations
.HasColumnName("follow_up_content") .HasColumnName("follow_up_content")
.HasComment("随访内容"); .HasComment("随访内容");
b.Property<Guid?>("FollowUpId")
b.Property<Guid>("FollowUpId")
.HasColumnType("uuid") .HasColumnType("uuid")
.HasColumnName("follow_up_id"); .HasColumnName("follow_up_id");
@ -7863,11 +7863,6 @@ namespace Shentun.Peis.Migrations
.HasColumnType("uuid") .HasColumnType("uuid")
.HasColumnName("last_modifier_id"); .HasColumnName("last_modifier_id");
b.Property<Guid>("PatientRegisterId")
.HasColumnType("uuid")
.HasColumnName("patient_register_id")
.HasComment("病人登记ID");
b.Property<string>("ReplyContent") b.Property<string>("ReplyContent")
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("character varying(200)") .HasColumnType("character varying(200)")
@ -7876,7 +7871,7 @@ namespace Shentun.Peis.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("PatientRegisterId");
b.HasIndex("FollowUpId");
b.ToTable("phone_follow_up"); b.ToTable("phone_follow_up");
@ -14516,13 +14511,14 @@ namespace Shentun.Peis.Migrations
modelBuilder.Entity("Shentun.Peis.Models.PhoneFollowUp", b => modelBuilder.Entity("Shentun.Peis.Models.PhoneFollowUp", b =>
{ {
b.HasOne("Shentun.Peis.Models.PatientRegister", "PatientRegister")
.WithMany("PhoneFollows")
.HasForeignKey("PatientRegisterId")
b.HasOne("Shentun.Peis.Models.FollowUp", "FollowUp")
.WithMany("PhoneFollowUps")
.HasForeignKey("FollowUpId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired() .IsRequired()
.HasConstraintName("fk_phone_f");
.HasConstraintName("fk_phone_follow_follow_up");
b.Navigation("PatientRegister");
b.Navigation("FollowUp");
}); });
modelBuilder.Entity("Shentun.Peis.Models.Poison", b => modelBuilder.Entity("Shentun.Peis.Models.Poison", b =>
@ -15340,6 +15336,11 @@ namespace Shentun.Peis.Migrations
b.Navigation("DiagnosisTemplateDetails"); b.Navigation("DiagnosisTemplateDetails");
}); });
modelBuilder.Entity("Shentun.Peis.Models.FollowUp", b =>
{
b.Navigation("PhoneFollowUps");
});
modelBuilder.Entity("Shentun.Peis.Models.Grouping", b => modelBuilder.Entity("Shentun.Peis.Models.Grouping", b =>
{ {
b.Navigation("UserGroupings"); b.Navigation("UserGroupings");
@ -15441,8 +15442,6 @@ namespace Shentun.Peis.Migrations
b.Navigation("PatientSymptoms"); b.Navigation("PatientSymptoms");
b.Navigation("PhoneFollows");
b.Navigation("QueueRegisters"); b.Navigation("QueueRegisters");
b.Navigation("RegisterCheckAsbitems"); b.Navigation("RegisterCheckAsbitems");

Loading…
Cancel
Save