สร้าง table บรรจุ
This commit is contained in:
parent
b0228a5277
commit
d387cc68bc
10 changed files with 12070 additions and 0 deletions
|
|
@ -0,0 +1,580 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addtableplacements : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlacementIsProperties",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Name = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อคุณสมบัติ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlacementIsProperties", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Placements",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Name = table.Column<string>(type: "longtext", nullable: false, comment: "รอบการสอบ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Round = table.Column<string>(type: "longtext", nullable: false, comment: "ครั้งที่")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Year = table.Column<int>(type: "int", maxLength: 5, nullable: false, comment: "ปีงบประมาณ"),
|
||||
Number = table.Column<int>(type: "int", maxLength: 10, nullable: false, comment: "จำนวนผู้สอบได้"),
|
||||
TypeExam = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภทการสอบ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
StartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันที่เริ่มบัญชีบัญชี"),
|
||||
EndDate = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันที่สิ้นสุดบัญชี"),
|
||||
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Placements", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlacementStatuses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Name = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อสถานะบรรจุ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlacementStatuses", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlacementProfiles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PlacementId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
PrefixId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
Firstname = table.Column<string>(type: "longtext", nullable: true, comment: "ชื่อ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Lastname = table.Column<string>(type: "longtext", nullable: true, comment: "นามสกุล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Number = table.Column<int>(type: "int", nullable: true, comment: "ลำดับที่สอบได้"),
|
||||
OrganizationPositionId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
RecruitDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่บรรจุ"),
|
||||
Amount = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน"),
|
||||
PositionSalaryAmount = table.Column<double>(type: "double", nullable: true, comment: "เงินประจำตำแหน่ง"),
|
||||
MouthSalaryAmount = table.Column<double>(type: "double", nullable: true, comment: "เงินค่าตอบแทนรายเดือน"),
|
||||
SalaryClass = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง (รายละเอียด)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
SalaryRef = table.Column<string>(type: "longtext", nullable: true, comment: "เอกสารอ้างอิง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
IsOfficer = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "ข้าราชการฯ กทม."),
|
||||
PlacementStatusId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
RejectReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลสละสิทธิ์")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ReliefReason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลผ่อนผัน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ReliefDocId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
IsProperty = table.Column<string>(type: "longtext", nullable: true, comment: "การคัดกรองคุณสมบัติ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Nationality = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true, comment: "สัญชาติ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DateOfBirth = table.Column<DateTime>(type: "datetime(6)", maxLength: 40, nullable: true, comment: "วันเกิด"),
|
||||
RelationshipId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
Email = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "อีเมล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CitizenId = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เลขประจำตัวประชาชน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CitizenDistrictId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
CitizenProvinceId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
CitizenDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ออกบัตร"),
|
||||
Telephone = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "โทรศัพท์")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MobilePhone = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "โทรศัพท์มือถือ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Knowledge = table.Column<string>(type: "longtext", nullable: true, comment: "ความสามารถพิเศษ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
RegistAddress = table.Column<string>(type: "longtext", nullable: true, comment: "ที่อยู่ตามทะเบียนบ้าน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
RegistProvinceId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
RegistDistrictId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
RegistSubDistrictId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
RegistZipCode = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true, comment: "รหัสไปรษณีย์ที่อยู่ตามทะเบียนบ้าน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
RegistSame = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "ที่อยู่ปัจจุบันเหมือนที่อยู่ตามทะเบียนบ้าน"),
|
||||
CurrentAddress = table.Column<string>(type: "longtext", nullable: true, comment: "ที่อยู่ปัจจุบัน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CurrentProvinceId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
CurrentDistrictId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
CurrentSubDistrictId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
CurrentZipCode = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: true, comment: "รหัสไปรษณีย์ที่อยู่ปัจจุบัน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Marry = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "คู่สมรส"),
|
||||
MarryPrefixId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
MarryFirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อจริงคู่สมรส")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MarryLastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุลคู่สมรส")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MarryOccupation = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "อาชีพคู่สมรส")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MarryNationality = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติคู่สมรส")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FatherPrefixId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
FatherFirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อจริงบิดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FatherLastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุลบิดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FatherOccupation = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "อาชีพบิดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FatherNationality = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติบิดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MotherPrefixId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
MotherFirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อจริงมารดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MotherLastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "นามสกุลมารดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MotherOccupation = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "อาชีพมารดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
MotherNationality = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติมารดา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
OccupationType = table.Column<string>(type: "longtext", nullable: true, comment: "ประเภทอาชีพที่ทำงานมาก่อน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
OccupationCompany = table.Column<string>(type: "longtext", nullable: true, comment: "สำนัก/บริษัท บริษัท")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
OccupationDepartment = table.Column<string>(type: "longtext", nullable: true, comment: "กอง/ฝ่าย บริษัท")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
OccupationEmail = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "อีเมล บริษัท")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
OccupationTelephone = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "โทรศัพท์ บริษัท")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
OccupationPosition = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่งอาชีพ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PositionNumberId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
PositionPathId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
PositionPathSideId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
PositionTypeId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
PositionLineId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
PositionLevelId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
PointTotalA = table.Column<double>(type: "double", nullable: true, comment: "คะแนนเต็มภาค ก"),
|
||||
PointA = table.Column<double>(type: "double", nullable: true, comment: "คะแนนภาค ก"),
|
||||
PointTotalB = table.Column<double>(type: "double", nullable: true, comment: "คะแนนเต็มภาค ข"),
|
||||
PointB = table.Column<double>(type: "double", nullable: true, comment: "คะแนนภาค ข"),
|
||||
PointTotalC = table.Column<double>(type: "double", nullable: true, comment: "คะแนนเต็มภาค ค"),
|
||||
PointC = table.Column<double>(type: "double", nullable: true, comment: "คะแนนภาค ค"),
|
||||
ExamNumber = table.Column<int>(type: "int", nullable: false, comment: "ลำดับที่สอบได้"),
|
||||
ExamRound = table.Column<int>(type: "int", nullable: false, comment: "จำนวนครั้งที่สมัครสอบ"),
|
||||
Pass = table.Column<string>(type: "longtext", nullable: true, comment: "ผลสมัครสอบ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlacementProfiles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Districts_CitizenDistrictId",
|
||||
column: x => x.CitizenDistrictId,
|
||||
principalTable: "Districts",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Districts_CurrentDistrictId",
|
||||
column: x => x.CurrentDistrictId,
|
||||
principalTable: "Districts",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Districts_RegistDistrictId",
|
||||
column: x => x.RegistDistrictId,
|
||||
principalTable: "Districts",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Documents_ReliefDocId",
|
||||
column: x => x.ReliefDocId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_OrganizationPositions_OrganizationPosition~",
|
||||
column: x => x.OrganizationPositionId,
|
||||
principalTable: "OrganizationPositions",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_PlacementStatuses_PlacementStatusId",
|
||||
column: x => x.PlacementStatusId,
|
||||
principalTable: "PlacementStatuses",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Placements_PlacementId",
|
||||
column: x => x.PlacementId,
|
||||
principalTable: "Placements",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_PositionLevels_PositionLevelId",
|
||||
column: x => x.PositionLevelId,
|
||||
principalTable: "PositionLevels",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_PositionLines_PositionLineId",
|
||||
column: x => x.PositionLineId,
|
||||
principalTable: "PositionLines",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_PositionNumbers_PositionNumberId",
|
||||
column: x => x.PositionNumberId,
|
||||
principalTable: "PositionNumbers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_PositionPathSides_PositionPathSideId",
|
||||
column: x => x.PositionPathSideId,
|
||||
principalTable: "PositionPathSides",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_PositionPaths_PositionPathId",
|
||||
column: x => x.PositionPathId,
|
||||
principalTable: "PositionPaths",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_PositionTypes_PositionTypeId",
|
||||
column: x => x.PositionTypeId,
|
||||
principalTable: "PositionTypes",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Prefixes_FatherPrefixId",
|
||||
column: x => x.FatherPrefixId,
|
||||
principalTable: "Prefixes",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Prefixes_MarryPrefixId",
|
||||
column: x => x.MarryPrefixId,
|
||||
principalTable: "Prefixes",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Prefixes_MotherPrefixId",
|
||||
column: x => x.MotherPrefixId,
|
||||
principalTable: "Prefixes",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Prefixes_PrefixId",
|
||||
column: x => x.PrefixId,
|
||||
principalTable: "Prefixes",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Provinces_CitizenProvinceId",
|
||||
column: x => x.CitizenProvinceId,
|
||||
principalTable: "Provinces",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Provinces_CurrentProvinceId",
|
||||
column: x => x.CurrentProvinceId,
|
||||
principalTable: "Provinces",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Provinces_RegistProvinceId",
|
||||
column: x => x.RegistProvinceId,
|
||||
principalTable: "Provinces",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_Relationships_RelationshipId",
|
||||
column: x => x.RelationshipId,
|
||||
principalTable: "Relationships",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_SubDistricts_CurrentSubDistrictId",
|
||||
column: x => x.CurrentSubDistrictId,
|
||||
principalTable: "SubDistricts",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementProfiles_SubDistricts_RegistSubDistrictId",
|
||||
column: x => x.RegistSubDistrictId,
|
||||
principalTable: "SubDistricts",
|
||||
principalColumn: "Id");
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlacementCareers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PlacementProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DurationStart = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "ระยะเวลาเริ่ม"),
|
||||
DurationEnd = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "ระยะเวลาสิ้นสุด"),
|
||||
Name = table.Column<string>(type: "longtext", nullable: false, comment: "สถานที่ทำงาน/ฝึกงาน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Position = table.Column<string>(type: "longtext", nullable: false, comment: "ตำแหน่ง/ลักษณะงาน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Salary = table.Column<int>(type: "int", maxLength: 20, nullable: false, comment: "เงินเดือนสุดท้ายก่อนออก"),
|
||||
Reason = table.Column<string>(type: "longtext", nullable: false, comment: "เหตุผลที่ออก")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlacementCareers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementCareers_PlacementProfiles_PlacementProfileId",
|
||||
column: x => x.PlacementProfileId,
|
||||
principalTable: "PlacementProfiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PlacementEducations",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PlacementProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
EducationLevelId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
Major = table.Column<string>(type: "longtext", nullable: false, comment: "สาขาวิชา/วิชาเอก")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Scores = table.Column<float>(type: "float", maxLength: 10, nullable: false, comment: "คะแนนเฉลี่ยตลอดหลักสูตร"),
|
||||
Name = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อสถานศึกษา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DurationStart = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "ระยะเวลาเริ่ม"),
|
||||
DurationEnd = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "ระยะเวลาสิ้นสุด")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PlacementEducations", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementEducations_EducationLevels_EducationLevelId",
|
||||
column: x => x.EducationLevelId,
|
||||
principalTable: "EducationLevels",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PlacementEducations_PlacementProfiles_PlacementProfileId",
|
||||
column: x => x.PlacementProfileId,
|
||||
principalTable: "PlacementProfiles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementCareers_PlacementProfileId",
|
||||
table: "PlacementCareers",
|
||||
column: "PlacementProfileId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementEducations_EducationLevelId",
|
||||
table: "PlacementEducations",
|
||||
column: "EducationLevelId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementEducations_PlacementProfileId",
|
||||
table: "PlacementEducations",
|
||||
column: "PlacementProfileId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_CitizenDistrictId",
|
||||
table: "PlacementProfiles",
|
||||
column: "CitizenDistrictId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_CitizenProvinceId",
|
||||
table: "PlacementProfiles",
|
||||
column: "CitizenProvinceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_CurrentDistrictId",
|
||||
table: "PlacementProfiles",
|
||||
column: "CurrentDistrictId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_CurrentProvinceId",
|
||||
table: "PlacementProfiles",
|
||||
column: "CurrentProvinceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_CurrentSubDistrictId",
|
||||
table: "PlacementProfiles",
|
||||
column: "CurrentSubDistrictId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_FatherPrefixId",
|
||||
table: "PlacementProfiles",
|
||||
column: "FatherPrefixId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_MarryPrefixId",
|
||||
table: "PlacementProfiles",
|
||||
column: "MarryPrefixId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_MotherPrefixId",
|
||||
table: "PlacementProfiles",
|
||||
column: "MotherPrefixId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_OrganizationPositionId",
|
||||
table: "PlacementProfiles",
|
||||
column: "OrganizationPositionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PlacementId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PlacementId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PlacementStatusId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PlacementStatusId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PositionLevelId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PositionLevelId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PositionLineId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PositionLineId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PositionNumberId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PositionNumberId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PositionPathId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PositionPathId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PositionPathSideId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PositionPathSideId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PositionTypeId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PositionTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_PrefixId",
|
||||
table: "PlacementProfiles",
|
||||
column: "PrefixId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_RegistDistrictId",
|
||||
table: "PlacementProfiles",
|
||||
column: "RegistDistrictId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_RegistProvinceId",
|
||||
table: "PlacementProfiles",
|
||||
column: "RegistProvinceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_RegistSubDistrictId",
|
||||
table: "PlacementProfiles",
|
||||
column: "RegistSubDistrictId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_RelationshipId",
|
||||
table: "PlacementProfiles",
|
||||
column: "RelationshipId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PlacementProfiles_ReliefDocId",
|
||||
table: "PlacementProfiles",
|
||||
column: "ReliefDocId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlacementCareers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlacementEducations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlacementIsProperties");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlacementProfiles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PlacementStatuses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Placements");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue