ดิงข้อมูลหลักจาก dbกลาง
This commit is contained in:
parent
2f292d25ca
commit
4e8520eb01
44 changed files with 4642 additions and 2590 deletions
|
|
@ -15,19 +15,19 @@ namespace BMA.EHR.Recurit.Exam.Service.Data
|
|||
{
|
||||
}
|
||||
|
||||
public DbSet<Prefix> Prefixes { get; set; }
|
||||
// public DbSet<Prefix> Prefixes { get; set; }
|
||||
|
||||
public DbSet<Religion> Religions { get; set; }
|
||||
// public DbSet<Religion> Religions { get; set; }
|
||||
|
||||
public DbSet<Relationship> Relationships { get; set; }
|
||||
// public DbSet<Relationship> Relationships { get; set; }
|
||||
|
||||
public DbSet<EducationLevel> EducationLevels { get; set; }
|
||||
// public DbSet<EducationLevel> EducationLevels { get; set; }
|
||||
|
||||
public DbSet<Province> Provinces { get; set; }
|
||||
// public DbSet<Province> Provinces { get; set; }
|
||||
|
||||
public DbSet<District> Districts { get; set; }
|
||||
// public DbSet<District> Districts { get; set; }
|
||||
|
||||
public DbSet<SubDistrict> SubDistricts { get; set; }
|
||||
// public DbSet<SubDistrict> SubDistricts { get; set; }
|
||||
|
||||
public DbSet<PeriodExam> PeriodExams { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -13,302 +13,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data
|
|||
|
||||
#region " Seed Metadata "
|
||||
|
||||
public static async Task SeedPrefixAsync(WebApplication app)
|
||||
{
|
||||
using var scope = app.Services.CreateScope();
|
||||
var service = scope.ServiceProvider.GetRequiredService<PrefixService>();
|
||||
var insertedPrefix = new List<Prefix>();
|
||||
|
||||
if ((await service.GetsAsync()).Count() == 0)
|
||||
{
|
||||
// read excels into object
|
||||
var excelFile = "SeedPerson.xlsx";
|
||||
using (var excel = new ExcelPackage(new FileInfo(excelFile)))
|
||||
{
|
||||
// 1. Seed PrefixAsync
|
||||
var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "prefix");
|
||||
var totalRows = workSheet?.Dimension.Rows;
|
||||
|
||||
int row = 1;
|
||||
|
||||
while (row <= totalRows)
|
||||
{
|
||||
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var prefix = insertedPrefix.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue<string>() ?? "")).FirstOrDefault();
|
||||
if (prefix == null)
|
||||
{
|
||||
var inserted = new Prefix
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = workSheet?.Cells[row, 1]?.GetValue<string>() ?? "",
|
||||
IsActive = true,
|
||||
CreatedFullName = "System Administrator",
|
||||
CreatedAt = DateTime.Now
|
||||
};
|
||||
insertedPrefix.Add(inserted);
|
||||
|
||||
await service.CreateAsync(inserted);
|
||||
}
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task SeedReligionAsync(WebApplication app)
|
||||
{
|
||||
using var scope = app.Services.CreateScope();
|
||||
var service = scope.ServiceProvider.GetRequiredService<ReligionService>();
|
||||
var insertedReligion = new List<Religion>();
|
||||
|
||||
if ((await service.GetsAsync()).Count() == 0)
|
||||
{
|
||||
// read excels into object
|
||||
var excelFile = "SeedPerson.xlsx";
|
||||
using (var excel = new ExcelPackage(new FileInfo(excelFile)))
|
||||
{
|
||||
// 1. Seed Religion
|
||||
var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "religion");
|
||||
var totalRows = workSheet?.Dimension.Rows;
|
||||
|
||||
int row = 1;
|
||||
|
||||
while (row <= totalRows)
|
||||
{
|
||||
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var religion = insertedReligion.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue<string>() ?? "")).FirstOrDefault();
|
||||
if (religion == null)
|
||||
{
|
||||
var inserted = new Religion
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = workSheet?.Cells[row, 1]?.GetValue<string>() ?? "",
|
||||
IsActive = true,
|
||||
CreatedFullName = "System Administrator",
|
||||
CreatedAt = DateTime.Now
|
||||
};
|
||||
insertedReligion.Add(inserted);
|
||||
|
||||
await service.CreateAsync(inserted);
|
||||
}
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task SeedRelationshipAsync(WebApplication app)
|
||||
{
|
||||
using var scope = app.Services.CreateScope();
|
||||
var service = scope.ServiceProvider.GetRequiredService<RelationshipService>();
|
||||
var insertedRelationship = new List<Relationship>();
|
||||
|
||||
if ((await service.GetsAsync()).Count() == 0)
|
||||
{
|
||||
// read excels into object
|
||||
var excelFile = "SeedPerson.xlsx";
|
||||
using (var excel = new ExcelPackage(new FileInfo(excelFile)))
|
||||
{
|
||||
// 1. Seed Relationship
|
||||
var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "relationship");
|
||||
var totalRows = workSheet?.Dimension.Rows;
|
||||
|
||||
int row = 1;
|
||||
|
||||
while (row <= totalRows)
|
||||
{
|
||||
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var relationship = insertedRelationship.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue<string>() ?? "")).FirstOrDefault();
|
||||
if (relationship == null)
|
||||
{
|
||||
var inserted = new Relationship
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = workSheet?.Cells[row, 1]?.GetValue<string>() ?? "",
|
||||
IsActive = true,
|
||||
CreatedFullName = "System Administrator",
|
||||
CreatedAt = DateTime.Now
|
||||
};
|
||||
insertedRelationship.Add(inserted);
|
||||
|
||||
await service.CreateAsync(inserted);
|
||||
}
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task SeedEducationLevelAsync(WebApplication app)
|
||||
{
|
||||
using var scope = app.Services.CreateScope();
|
||||
var service = scope.ServiceProvider.GetRequiredService<EducationLevelService>();
|
||||
var insertedEducationLevel = new List<EducationLevel>();
|
||||
|
||||
if ((await service.GetsAsync()).Count() == 0)
|
||||
{
|
||||
// read excels into object
|
||||
var excelFile = "SeedPerson.xlsx";
|
||||
using (var excel = new ExcelPackage(new FileInfo(excelFile)))
|
||||
{
|
||||
// 1. Seed EducationLevel
|
||||
var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "educationlevel");
|
||||
var totalRows = workSheet?.Dimension.Rows;
|
||||
|
||||
int row = 1;
|
||||
|
||||
while (row <= totalRows)
|
||||
{
|
||||
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var educationLevel = insertedEducationLevel.Where(x => x.Name == (workSheet?.Cells[row, 1]?.GetValue<string>() ?? "")).FirstOrDefault();
|
||||
if (educationLevel == null)
|
||||
{
|
||||
var inserted = new EducationLevel
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = workSheet?.Cells[row, 1]?.GetValue<string>() ?? "",
|
||||
IsActive = true,
|
||||
CreatedFullName = "System Administrator",
|
||||
CreatedAt = DateTime.Now
|
||||
};
|
||||
insertedEducationLevel.Add(inserted);
|
||||
|
||||
await service.CreateAsync(inserted);
|
||||
}
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task SeedProvinceAsync(WebApplication app)
|
||||
{
|
||||
using var scope = app.Services.CreateScope();
|
||||
var service = scope.ServiceProvider.GetRequiredService<ProvinceService>();
|
||||
var districtService = scope.ServiceProvider.GetRequiredService<DistrictService>();
|
||||
var subDistrictService = scope.ServiceProvider.GetRequiredService<SubDistrictService>();
|
||||
|
||||
var serializeOption = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore };
|
||||
|
||||
var insertedProvince = new List<Province>();
|
||||
|
||||
if ((await service.GetsAsync()).Count() == 0)
|
||||
{
|
||||
// read excels into object
|
||||
var excelFile = "SeedPerson.xlsx";
|
||||
using (var excel = new ExcelPackage(new FileInfo(excelFile)))
|
||||
{
|
||||
// 1. Seed Province
|
||||
var workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "province");
|
||||
var totalRows = workSheet?.Dimension.Rows;
|
||||
|
||||
int row = 2;
|
||||
|
||||
while (row <= totalRows)
|
||||
{
|
||||
var cell1 = workSheet?.Cells[row, 1]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var inserted = new Province
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = workSheet?.Cells[row, 1]?.GetValue<string>() ?? "",
|
||||
IsActive = true,
|
||||
CreatedFullName = "System Administrator",
|
||||
CreatedAt = DateTime.Now,
|
||||
Districts = new List<District>()
|
||||
};
|
||||
insertedProvince.Add(inserted);
|
||||
|
||||
await service.CreateAsync(inserted);
|
||||
|
||||
row++;
|
||||
}
|
||||
|
||||
// 2. Seed District
|
||||
var d_workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "district");
|
||||
var d_totalRows = d_workSheet?.Dimension.Rows;
|
||||
|
||||
int d_row = 2;
|
||||
|
||||
while (d_row <= d_totalRows)
|
||||
{
|
||||
var cell1 = d_workSheet?.Cells[d_row, 1]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var province = insertedProvince.Where(x => x.Name == cell1).FirstOrDefault();
|
||||
|
||||
var inserted = new District
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = d_workSheet?.Cells[d_row, 2]?.GetValue<string>() ?? "",
|
||||
IsActive = true,
|
||||
CreatedFullName = "System Administrator",
|
||||
CreatedAt = DateTime.Now,
|
||||
SubDistricts = new List<SubDistrict>()
|
||||
};
|
||||
|
||||
province?.Districts.Add(inserted);
|
||||
var provinceId = province == null ? Guid.NewGuid() : province.Id;
|
||||
|
||||
var jsonString = JsonConvert.SerializeObject(inserted, serializeOption);
|
||||
|
||||
await districtService.CreateAsync(inserted, provinceId.ToString("D"));
|
||||
|
||||
d_row++;
|
||||
}
|
||||
|
||||
|
||||
// 3. Seed SubDistrict
|
||||
var s_workSheet = excel.Workbook.Worksheets.FirstOrDefault(x => x.Name.ToLower() == "subdistrict");
|
||||
var s_totalRows = s_workSheet?.Dimension.Rows;
|
||||
|
||||
int s_row = 2;
|
||||
var zipcodes = new List<string>();
|
||||
|
||||
while (s_row <= s_totalRows)
|
||||
{
|
||||
var cell1 = s_workSheet?.Cells[s_row, 1]?.GetValue<string>();
|
||||
var cell2 = s_workSheet?.Cells[s_row, 2]?.GetValue<string>();
|
||||
if (cell1 == "" || cell1 == null) break;
|
||||
|
||||
var province = insertedProvince.Where(x => x.Name == cell1).FirstOrDefault();
|
||||
var district = province?.Districts.Where(x => x.Name == cell2).FirstOrDefault();
|
||||
|
||||
var inserted = new SubDistrict
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = s_workSheet?.Cells[s_row, 3]?.GetValue<string>() ?? "",
|
||||
ZipCode = s_workSheet?.Cells[s_row, 4]?.GetValue<string>() ?? "",
|
||||
IsActive = true,
|
||||
CreatedFullName = "System Administrator",
|
||||
CreatedAt = DateTime.Now,
|
||||
|
||||
};
|
||||
|
||||
if (!zipcodes.Contains(inserted.ZipCode))
|
||||
zipcodes.Add(inserted.ZipCode);
|
||||
|
||||
district?.SubDistricts.Add(inserted);
|
||||
var districtId = district == null ? Guid.NewGuid() : district.Id;
|
||||
|
||||
var jsonString = JsonConvert.SerializeObject(inserted, serializeOption);
|
||||
|
||||
await subDistrictService.CreateAsync(inserted, districtId.ToString("D"));
|
||||
|
||||
s_row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static async Task SeedPeriodExamAsync(WebApplication app)
|
||||
{
|
||||
// using var scope = app.Services.CreateScope();
|
||||
|
|
|
|||
55
Data/MetadataDbContext.cs
Normal file
55
Data/MetadataDbContext.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using BMA.EHR.Recurit.Exam.Service.Models;
|
||||
using BMA.EHR.Recurit.Exam.Service.Models.Documents;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Recurit.Exam.Service.Data
|
||||
{
|
||||
public class MetadataDbContext : DbContext
|
||||
{
|
||||
public MetadataDbContext(DbContextOptions<MetadataDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
}
|
||||
|
||||
// The following configures EF to create a Sqlite database file in the
|
||||
// special "local" folder for your platform.
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
{
|
||||
if (!options.IsConfigured)
|
||||
{
|
||||
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production";
|
||||
var configurationBuilder = new ConfigurationBuilder()
|
||||
.AddJsonFile("appsettings.json", optional: true, true)
|
||||
.AddJsonFile($"appsettings.{environment}.json", true, true)
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
|
||||
var historyConnection = configurationBuilder.GetConnectionString("HistoryConnection");
|
||||
options.UseMySql(historyConnection, ServerVersion.AutoDetect(historyConnection));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public DbSet<Prefix> Prefixes { get; set; }
|
||||
|
||||
public DbSet<Religion> Religions { get; set; }
|
||||
|
||||
public DbSet<EducationLevel> EducationLevels { get; set; }
|
||||
|
||||
public DbSet<Relationship> Relationships { get; set; }
|
||||
|
||||
public DbSet<Province> Provinces { get; set; }
|
||||
|
||||
public DbSet<District> Districts { get; set; }
|
||||
|
||||
public DbSet<SubDistrict> SubDistricts { get; set; }
|
||||
|
||||
public DbSet<OrganizationOrganization> OrganizationOrganizations { get; set; }
|
||||
|
||||
public DbSet<OrganizationShortName> OrganizationShortNames { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ที่อยู่");
|
||||
.HasComment("ที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<Guid?>("BannerImgId")
|
||||
.HasColumnType("char(36)");
|
||||
|
|
@ -197,7 +197,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("ข้อมูลเว็บโดยย่อ");
|
||||
|
||||
b.Property<Guid?>("DistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id อำเภอ");
|
||||
|
||||
b.Property<string>("DistrictName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("อำเภอ");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
|
|
@ -230,14 +235,24 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("ชื่อเว็บภาษาไทย");
|
||||
|
||||
b.Property<Guid?>("ProvinceId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id จังหวัด");
|
||||
|
||||
b.Property<string>("ProvinceName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("จังหวัด");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ชื่อย่อ");
|
||||
|
||||
b.Property<Guid?>("SubDistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id ตำบล");
|
||||
|
||||
b.Property<string>("SubDistrictName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ตำบล");
|
||||
|
||||
b.Property<string>("Telephone")
|
||||
.HasMaxLength(20)
|
||||
|
|
@ -253,14 +268,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
|
||||
b.HasIndex("BannerImgId");
|
||||
|
||||
b.HasIndex("DistrictId");
|
||||
|
||||
b.HasIndex("LogoImgId");
|
||||
|
||||
b.HasIndex("ProvinceId");
|
||||
|
||||
b.HasIndex("SubDistrictId");
|
||||
|
||||
b.ToTable("CMSCandidates");
|
||||
});
|
||||
|
||||
|
|
@ -343,7 +352,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("วันที่ออกบัตร");
|
||||
|
||||
b.Property<Guid?>("CitizenDistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id เขตที่ออกบัตรประชาชน");
|
||||
|
||||
b.Property<string>("CitizenDistrictName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("เขตที่ออกบัตรประชาชน");
|
||||
|
||||
b.Property<string>("CitizenId")
|
||||
.HasMaxLength(20)
|
||||
|
|
@ -351,7 +365,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("เลขประจำตัวประชาชน");
|
||||
|
||||
b.Property<Guid?>("CitizenProvinceId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id จังหวัดที่ออกบัตรประชาชน");
|
||||
|
||||
b.Property<string>("CitizenProvinceName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("จังหวัดที่ออกบัตรประชาชน");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
|
|
@ -377,13 +396,28 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("ที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<Guid?>("CurrentDistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id อำเภอที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<string>("CurrentDistrictName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("อำเภอที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<Guid?>("CurrentProvinceId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id จังหวัดที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<string>("CurrentProvinceName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("จังหวัดที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<Guid?>("CurrentSubDistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id ตำบลที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<string>("CurrentSubDistrictName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ตำบลที่อยู่ปัจจุบัน");
|
||||
|
||||
b.Property<string>("CurrentZipCode")
|
||||
.HasMaxLength(10)
|
||||
|
|
@ -425,7 +459,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("อาชีพบิดา");
|
||||
|
||||
b.Property<Guid?>("FatherPrefixId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id คำนำหน้าชื่อบิดา");
|
||||
|
||||
b.Property<string>("FatherPrefixName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("คำนำหน้าชื่อบิดา");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasMaxLength(100)
|
||||
|
|
@ -487,7 +526,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("อาชีพคู่สมรส");
|
||||
|
||||
b.Property<Guid?>("MarryPrefixId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id คำนำหน้าชื่อคู่สมรส");
|
||||
|
||||
b.Property<string>("MarryPrefixName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("คำนำหน้าชื่อคู่สมรส");
|
||||
|
||||
b.Property<string>("MobilePhone")
|
||||
.HasMaxLength(20)
|
||||
|
|
@ -515,7 +559,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("อาชีพมารดา");
|
||||
|
||||
b.Property<Guid?>("MotherPrefixId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id คำนำหน้าชื่อมารดา");
|
||||
|
||||
b.Property<string>("MotherPrefixName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("คำนำหน้าชื่อมารดา");
|
||||
|
||||
b.Property<string>("Nationality")
|
||||
.HasMaxLength(40)
|
||||
|
|
@ -563,7 +612,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid?>("PrefixId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id คำนำหน้าชื่อ");
|
||||
|
||||
b.Property<string>("PrefixName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("คำนำหน้าชื่อ");
|
||||
|
||||
b.Property<Guid?>("ProfileImgId")
|
||||
.HasColumnType("char(36)");
|
||||
|
|
@ -573,17 +627,32 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("ที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<Guid?>("RegistDistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id อำเภอที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<string>("RegistDistrictName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("อำเภอที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<Guid?>("RegistProvinceId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id จังหวัดที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<string>("RegistProvinceName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("จังหวัดที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<bool?>("RegistSame")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasComment("ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<Guid?>("RegistSubDistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id ตำบลที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<string>("RegistSubDistrictName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ตำบลที่อยู่ตามทะเบียนบ้าน");
|
||||
|
||||
b.Property<string>("RegistZipCode")
|
||||
.HasMaxLength(10)
|
||||
|
|
@ -595,7 +664,12 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasComment("เหตุผลการไม่อนุมัติ");
|
||||
|
||||
b.Property<Guid?>("RelationshipId")
|
||||
.HasColumnType("char(36)");
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Id ศาสนา");
|
||||
|
||||
b.Property<string>("RelationshipName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("ศาสนา");
|
||||
|
||||
b.Property<string>("SeatNumber")
|
||||
.HasColumnType("longtext")
|
||||
|
|
@ -620,40 +694,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CitizenDistrictId");
|
||||
|
||||
b.HasIndex("CitizenProvinceId");
|
||||
|
||||
b.HasIndex("CurrentDistrictId");
|
||||
|
||||
b.HasIndex("CurrentProvinceId");
|
||||
|
||||
b.HasIndex("CurrentSubDistrictId");
|
||||
|
||||
b.HasIndex("FatherPrefixId");
|
||||
|
||||
b.HasIndex("MarryPrefixId");
|
||||
|
||||
b.HasIndex("MotherPrefixId");
|
||||
|
||||
b.HasIndex("PaymentImgId");
|
||||
|
||||
b.HasIndex("PeriodExamId");
|
||||
|
||||
b.HasIndex("PositionExamId");
|
||||
|
||||
b.HasIndex("PrefixId");
|
||||
|
||||
b.HasIndex("ProfileImgId");
|
||||
|
||||
b.HasIndex("RegistDistrictId");
|
||||
|
||||
b.HasIndex("RegistProvinceId");
|
||||
|
||||
b.HasIndex("RegistSubDistrictId");
|
||||
|
||||
b.HasIndex("RelationshipId");
|
||||
|
||||
b.ToTable("Candidates");
|
||||
});
|
||||
|
||||
|
|
@ -810,75 +858,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.ToTable("Careers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("varchar(150)")
|
||||
.HasColumnOrder(1)
|
||||
.HasComment("เขต/อำเภอ");
|
||||
|
||||
b.Property<Guid?>("ProvinceId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProvinceId");
|
||||
|
||||
b.ToTable("Districts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -954,8 +933,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.HasColumnOrder(1)
|
||||
.HasComment("ระยะเวลาเริ่ม");
|
||||
|
||||
b.Property<Guid>("EducationLevelId")
|
||||
.HasColumnType("char(36)");
|
||||
b.Property<Guid?>("EducationLevelId")
|
||||
.HasColumnType("char(36)")
|
||||
.HasComment("Idวุฒิที่ได้รับ");
|
||||
|
||||
b.Property<string>("EducationLevelName")
|
||||
.HasColumnType("longtext")
|
||||
.HasComment("วุฒิที่ได้รับ");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
|
|
@ -998,75 +982,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
|
||||
b.HasIndex("CandidateId");
|
||||
|
||||
b.HasIndex("EducationLevelId");
|
||||
|
||||
b.ToTable("Educations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.EducationLevel", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)")
|
||||
.HasColumnOrder(1)
|
||||
.HasComment("ระดับการศึกษา");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("EducationLevels");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
|
@ -1414,338 +1332,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.ToTable("PositionExams");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Prefix", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(3)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("รายละเอียดคำนำหน้า");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prefixes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Province", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("varchar(150)")
|
||||
.HasColumnOrder(1)
|
||||
.HasComment("จังหวัด");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Provinces");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Relationship", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("varchar(50)")
|
||||
.HasColumnOrder(1)
|
||||
.HasComment("ชื่อความสัมพันธ์");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Relationships");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Religion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)")
|
||||
.HasColumnOrder(1)
|
||||
.HasComment("ศาสนา");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Religions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)")
|
||||
.HasColumnOrder(0)
|
||||
.HasComment("PrimaryKey")
|
||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(100)
|
||||
.HasComment("สร้างข้อมูลเมื่อ");
|
||||
|
||||
b.Property<string>("CreatedFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(104)
|
||||
.HasComment("ชื่อ User ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<string>("CreatedUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(101)
|
||||
.HasComment("User Id ที่สร้างข้อมูล");
|
||||
|
||||
b.Property<Guid?>("DistrictId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("tinyint(1)")
|
||||
.HasColumnOrder(3)
|
||||
.HasComment("สถานะการใช้งาน");
|
||||
|
||||
b.Property<string>("LastUpdateFullName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("varchar(200)")
|
||||
.HasColumnOrder(105)
|
||||
.HasComment("ชื่อ User ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<string>("LastUpdateUserId")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("varchar(40)")
|
||||
.HasColumnOrder(103)
|
||||
.HasComment("User Id ที่แก้ไขข้อมูลล่าสุด");
|
||||
|
||||
b.Property<DateTime?>("LastUpdatedAt")
|
||||
.HasColumnType("datetime(6)")
|
||||
.HasColumnOrder(102)
|
||||
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("varchar(150)")
|
||||
.HasColumnOrder(1)
|
||||
.HasComment("เขต/อำเภอ");
|
||||
|
||||
b.Property<string>("ZipCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("varchar(10)")
|
||||
.HasColumnOrder(2)
|
||||
.HasComment("รหัสไปรษณีย์");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DistrictId");
|
||||
|
||||
b.ToTable("SubDistricts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.BankExam", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", "PeriodExam")
|
||||
|
|
@ -1774,31 +1360,13 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.WithMany()
|
||||
.HasForeignKey("BannerImgId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "District")
|
||||
.WithMany()
|
||||
.HasForeignKey("DistrictId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "LogoImg")
|
||||
.WithMany()
|
||||
.HasForeignKey("LogoImgId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "Province")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProvinceId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "SubDistrict")
|
||||
.WithMany()
|
||||
.HasForeignKey("SubDistrictId");
|
||||
|
||||
b.Navigation("BannerImg");
|
||||
|
||||
b.Navigation("District");
|
||||
|
||||
b.Navigation("LogoImg");
|
||||
|
||||
b.Navigation("Province");
|
||||
|
||||
b.Navigation("SubDistrict");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSGovernment", b =>
|
||||
|
|
@ -1814,38 +1382,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Candidate", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "CitizenDistrict")
|
||||
.WithMany()
|
||||
.HasForeignKey("CitizenDistrictId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "CitizenProvince")
|
||||
.WithMany()
|
||||
.HasForeignKey("CitizenProvinceId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "CurrentDistrict")
|
||||
.WithMany()
|
||||
.HasForeignKey("CurrentDistrictId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "CurrentProvince")
|
||||
.WithMany()
|
||||
.HasForeignKey("CurrentProvinceId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "CurrentSubDistrict")
|
||||
.WithMany()
|
||||
.HasForeignKey("CurrentSubDistrictId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "FatherPrefix")
|
||||
.WithMany()
|
||||
.HasForeignKey("FatherPrefixId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "MarryPrefix")
|
||||
.WithMany()
|
||||
.HasForeignKey("MarryPrefixId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "MotherPrefix")
|
||||
.WithMany()
|
||||
.HasForeignKey("MotherPrefixId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "PaymentImg")
|
||||
.WithMany()
|
||||
.HasForeignKey("PaymentImgId");
|
||||
|
|
@ -1860,63 +1396,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.WithMany()
|
||||
.HasForeignKey("PositionExamId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Prefix", "Prefix")
|
||||
.WithMany()
|
||||
.HasForeignKey("PrefixId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Documents.Document", "ProfileImg")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProfileImgId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "RegistDistrict")
|
||||
.WithMany()
|
||||
.HasForeignKey("RegistDistrictId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "RegistProvince")
|
||||
.WithMany()
|
||||
.HasForeignKey("RegistProvinceId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", "RegistSubDistrict")
|
||||
.WithMany()
|
||||
.HasForeignKey("RegistSubDistrictId");
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Relationship", "Relationship")
|
||||
.WithMany()
|
||||
.HasForeignKey("RelationshipId");
|
||||
|
||||
b.Navigation("CitizenDistrict");
|
||||
|
||||
b.Navigation("CitizenProvince");
|
||||
|
||||
b.Navigation("CurrentDistrict");
|
||||
|
||||
b.Navigation("CurrentProvince");
|
||||
|
||||
b.Navigation("CurrentSubDistrict");
|
||||
|
||||
b.Navigation("FatherPrefix");
|
||||
|
||||
b.Navigation("MarryPrefix");
|
||||
|
||||
b.Navigation("MotherPrefix");
|
||||
|
||||
b.Navigation("PaymentImg");
|
||||
|
||||
b.Navigation("PeriodExam");
|
||||
|
||||
b.Navigation("PositionExam");
|
||||
|
||||
b.Navigation("Prefix");
|
||||
|
||||
b.Navigation("ProfileImg");
|
||||
|
||||
b.Navigation("RegistDistrict");
|
||||
|
||||
b.Navigation("RegistProvince");
|
||||
|
||||
b.Navigation("RegistSubDistrict");
|
||||
|
||||
b.Navigation("Relationship");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CandidateDocument", b =>
|
||||
|
|
@ -1949,15 +1439,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Navigation("Candidate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Province", "Province")
|
||||
.WithMany("Districts")
|
||||
.HasForeignKey("ProvinceId");
|
||||
|
||||
b.Navigation("Province");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Education", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.Candidate", "Candidate")
|
||||
|
|
@ -1966,15 +1447,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.EducationLevel", "EducationLevel")
|
||||
.WithMany()
|
||||
.HasForeignKey("EducationLevelId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Candidate");
|
||||
|
||||
b.Navigation("EducationLevel");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExamDocument", b =>
|
||||
|
|
@ -2026,15 +1499,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Navigation("PeriodExam");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.SubDistrict", b =>
|
||||
{
|
||||
b.HasOne("BMA.EHR.Recurit.Exam.Service.Models.District", "District")
|
||||
.WithMany("SubDistricts")
|
||||
.HasForeignKey("DistrictId");
|
||||
|
||||
b.Navigation("District");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.CMSCandidate", b =>
|
||||
{
|
||||
b.Navigation("CMSAgencys");
|
||||
|
|
@ -2042,11 +1506,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
b.Navigation("CMSGovernments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.District", b =>
|
||||
{
|
||||
b.Navigation("SubDistricts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.PeriodExam", b =>
|
||||
{
|
||||
b.Navigation("BankExam");
|
||||
|
|
@ -2059,11 +1518,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Data.Migrations
|
|||
|
||||
b.Navigation("PositionExam");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("BMA.EHR.Recurit.Exam.Service.Models.Province", b =>
|
||||
{
|
||||
b.Navigation("Districts");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue