//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Rdh.ElectronicMedicineKit.EntityFrameworkCore;
namespace Rdh.TestApi.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20221123081418_Init_Entities")]
partial class Init_Entities
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.17");
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.Drug", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("DrugBatchId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("DrugBatchId1")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("RFID")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("DrugBatchId1");
b.ToTable("Drugs");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.DrugBatch", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("BatchCode")
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("DrugId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("ExpiryDate")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("ManufactureDate")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("DrugId");
b.ToTable("DrugBatches");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.DrugInfo", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Manufacturer")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("Name")
.HasColumnType("TEXT");
b.Property("Specifications")
.HasColumnType("TEXT");
b.Property("Unit")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("DrugInfos");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKit", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Code")
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("KitType")
.HasColumnType("INTEGER");
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("MedicineKits");
b.HasData(
new
{
Id = "ffb59ddd-8448-4ffb-97e7-ef60a0f7ad91",
Code = "000",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
KitType = 3
});
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKitConfig", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("DrugId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("KitType")
.HasColumnType("INTEGER");
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("MaxAmount")
.HasColumnType("INTEGER");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("WarnAmount")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("DrugId");
b.ToTable("MedicineKitConfigs");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKitLocation", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Location")
.HasColumnType("INTEGER");
b.Property("MedicineKitId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("OperationRoomId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Unit")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("MedicineKitId");
b.HasIndex("OperationRoomId");
b.ToTable("MedicineKitLocations");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKitStock", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("DrugId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("MedicineKitDrugState")
.HasColumnType("INTEGER");
b.Property("MedicineKitId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("DrugId");
b.HasIndex("MedicineKitId");
b.ToTable("MedicineKitStocks");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.Operation", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("Department")
.HasColumnType("TEXT");
b.Property("DoctorId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("Name")
.HasColumnType("TEXT");
b.Property("PatientId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("State")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("DoctorId");
b.HasIndex("PatientId");
b.ToTable("Operations");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.OperationDrug", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("DrugId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("OperationId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("DrugId");
b.HasIndex("OperationId");
b.ToTable("OperationDrugs");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.OperationRoom", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("BaseStationCode")
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("Name")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("OperationRooms");
b.HasData(
new
{
Id = "c1822c7e-154d-4a0d-b038-b3f3d02c3314",
BaseStationCode = "00",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "手术间1"
},
new
{
Id = "0ae49e9f-bf4a-4315-aa38-32333c361835",
BaseStationCode = "01",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "手术间2"
},
new
{
Id = "11f05cb6-98a4-4001-a8c8-724c95c50411",
BaseStationCode = "02",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "手术间3"
});
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.Patient", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("BirthDay")
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("Gender")
.HasColumnType("INTEGER");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("Name")
.HasColumnType("TEXT");
b.Property("PatientNo")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Patients");
b.HasData(
new
{
Id = "04b9b64b-ec22-4d16-b83c-3e6f016e686e",
BirthDay = new DateTime(1995, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 0,
IsDeleted = false,
Name = "陶竹生",
PatientNo = "10232853"
},
new
{
Id = "2daa455d-d1f7-4a38-a6c4-ced217999377",
BirthDay = new DateTime(1987, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 1,
IsDeleted = false,
Name = "郦夏芳",
PatientNo = "10229717"
},
new
{
Id = "577d0c49-b977-49bb-b26e-d52e3858324d",
BirthDay = new DateTime(1977, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 1,
IsDeleted = false,
Name = "雷胜蓝",
PatientNo = "10251888"
},
new
{
Id = "437dd193-947e-49d2-a8cf-61eced8f0699",
BirthDay = new DateTime(1996, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 0,
IsDeleted = false,
Name = "张和初",
PatientNo = "10222577"
},
new
{
Id = "8adf25c9-fde4-4af9-a169-44564fb319dd",
BirthDay = new DateTime(1985, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 1,
IsDeleted = false,
Name = "王美华",
PatientNo = "10221218"
},
new
{
Id = "ea8d4c8a-bb20-4f70-95ac-d71efd5305a4",
BirthDay = new DateTime(1975, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 0,
IsDeleted = false,
Name = "谷乐平",
PatientNo = "10228969"
},
new
{
Id = "c18c3bc5-3895-418a-8f73-1e537678e7fa",
BirthDay = new DateTime(1999, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 1,
IsDeleted = false,
Name = "尤梅",
PatientNo = "10229521"
},
new
{
Id = "cc476616-31c5-4b99-bbf6-8e306678fb0d",
BirthDay = new DateTime(1965, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
Gender = 0,
IsDeleted = false,
Name = "骆元方",
PatientNo = "10228510"
});
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Code")
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Creator")
.HasColumnType("TEXT");
b.Property("DeletionTime")
.HasColumnType("TEXT");
b.Property("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER")
.HasDefaultValue(false);
b.Property("LastModificationTime")
.HasColumnType("TEXT");
b.Property("Modifier")
.HasColumnType("TEXT");
b.Property("Name")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Users");
b.HasData(
new
{
Id = "8fdbdac2-1903-4f1f-8ed5-a51079c77cb2",
Code = "a3ce8445",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "李浩"
},
new
{
Id = "ccac22d7-eb79-49ce-bf99-d47204812d64",
Code = "bb332e5a",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "罗岩"
},
new
{
Id = "c57d60fc-8738-4cf4-b477-60614f03b959",
Code = "bb332e52",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "刘强与"
},
new
{
Id = "e3c60e42-efe1-45c1-9608-831f5f1cf721",
Code = "bb332e53",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "文芳"
},
new
{
Id = "bdca9d5d-dda0-4a04-8190-11ecae578b15",
Code = "bb332e54",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "何颖"
},
new
{
Id = "4d997ded-50c3-4e66-b782-fe661313da4e",
Code = "bb332e55",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "张向丽"
},
new
{
Id = "14360b6a-c7ea-4081-a613-dd8d193911be",
Code = "bb332e56",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "汪玲"
},
new
{
Id = "a5b47d2d-ec05-4c04-a8bb-a8e11c9acdea",
Code = "bb332e57",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "李长风"
},
new
{
Id = "b4b140fc-0723-4b06-a416-6a2c13b1cf9c",
Code = "bb332e58",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "吴爱国"
},
new
{
Id = "0b89567d-29ac-464a-8989-53ce9590b1ed",
Code = "bb332e59",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "白丽"
},
new
{
Id = "e027dc86-d1cc-48dd-9d54-d516719336fd",
Code = "bb332f54",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "刘思雨"
},
new
{
Id = "d796d486-ecec-41ac-9313-8b2dcbb081e2",
Code = "bb332e51",
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
IsDeleted = false,
Name = "张宇"
});
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.Drug", b =>
{
b.HasOne("Rdh.ElectronicMedicineKit.Models.DrugBatch", "DrugBatch")
.WithMany()
.HasForeignKey("DrugBatchId1");
b.Navigation("DrugBatch");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.DrugBatch", b =>
{
b.HasOne("Rdh.ElectronicMedicineKit.Models.DrugInfo", "Drug")
.WithMany("DrugBatches")
.HasForeignKey("DrugId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Drug");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKitConfig", b =>
{
b.HasOne("Rdh.ElectronicMedicineKit.Models.DrugInfo", "Drug")
.WithMany()
.HasForeignKey("DrugId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Drug");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKitLocation", b =>
{
b.HasOne("Rdh.ElectronicMedicineKit.Models.MedicineKit", "MedicineKit")
.WithMany("Locations")
.HasForeignKey("MedicineKitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Rdh.ElectronicMedicineKit.Models.OperationRoom", "OperationRoom")
.WithMany()
.HasForeignKey("OperationRoomId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MedicineKit");
b.Navigation("OperationRoom");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKitStock", b =>
{
b.HasOne("Rdh.ElectronicMedicineKit.Models.Drug", "Drug")
.WithMany()
.HasForeignKey("DrugId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Rdh.ElectronicMedicineKit.Models.MedicineKit", "MedicineKit")
.WithMany("Stocks")
.HasForeignKey("MedicineKitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Drug");
b.Navigation("MedicineKit");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.Operation", b =>
{
b.HasOne("Rdh.ElectronicMedicineKit.Models.User", "Doctor")
.WithMany()
.HasForeignKey("DoctorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Rdh.ElectronicMedicineKit.Models.Patient", "Patient")
.WithMany()
.HasForeignKey("PatientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Doctor");
b.Navigation("Patient");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.OperationDrug", b =>
{
b.HasOne("Rdh.ElectronicMedicineKit.Models.Drug", "Drug")
.WithMany()
.HasForeignKey("DrugId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Rdh.ElectronicMedicineKit.Models.Operation", "Operation")
.WithMany("Drugs")
.HasForeignKey("OperationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Drug");
b.Navigation("Operation");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.DrugInfo", b =>
{
b.Navigation("DrugBatches");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.MedicineKit", b =>
{
b.Navigation("Locations");
b.Navigation("Stocks");
});
modelBuilder.Entity("Rdh.ElectronicMedicineKit.Models.Operation", b =>
{
b.Navigation("Drugs");
});
#pragma warning restore 612, 618
}
}
}