using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.ApplicationDB
{
///
public partial class InitforOracle : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CommandStatuses",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Name = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "สถานะของคำสั่ง"),
Sequence = table.Column(type: "NUMBER(10)", nullable: false, comment: "ลำดับการทำงาน")
},
constraints: table =>
{
table.PrimaryKey("PK_CommandStatuses", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CommandTypes",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Name = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อคำสั่ง"),
Category = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "ประเภทคำสั่ง"),
CommandCode = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "รหัสของประเภทคำสั่ง")
},
constraints: table =>
{
table.PrimaryKey("PK_CommandTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CronjobNotiProbations",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Subject = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง"),
Body = table.Column(type: "NCLOB", nullable: false, comment: "รายละเอียดข้อความ"),
ReceiverUserId = table.Column(type: "RAW(16)", nullable: false, comment: "รหัสผู้รับข้อความ"),
Payload = table.Column(type: "NCLOB", nullable: false, comment: "สิงที่แนบมาด้วย"),
IsSendMail = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งอีเมล์หรือไม่?"),
IsSendInbox = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งกล่องข้อความหรือไม่?"),
IsSendNoti = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งการแจ้งเตือนหรือยัง"),
ReceiveDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "วันที่ได้รับ")
},
constraints: table =>
{
table.PrimaryKey("PK_CronjobNotiProbations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DeploymentChannels",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
IsSendInbox = table.Column(type: "NUMBER(1)", nullable: false),
IsSendEmail = table.Column(type: "NUMBER(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DeploymentChannels", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Inboxes",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Subject = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง"),
Body = table.Column(type: "NCLOB", nullable: false, comment: "รายละเอียดข้อความ"),
ReceiverUserId = table.Column(type: "RAW(16)", nullable: false, comment: "รหัสผู้รับข้อความ"),
Payload = table.Column(type: "NCLOB", nullable: false, comment: "สิงที่แนบมาด้วย"),
IsOpen = table.Column(type: "NUMBER(1)", nullable: false, comment: "เปิดอ่านแล้วหรือยัง"),
ReceiveDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "วันที่ได้รับ"),
OpenDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เปิดอ่าน"),
DeleteDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่ลบข้อมูล")
},
constraints: table =>
{
table.PrimaryKey("PK_Inboxes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "InsigniaManages",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
InsigniaId = table.Column(type: "RAW(16)", nullable: false),
Year = table.Column(type: "NUMBER(10)", nullable: false, comment: "ปี"),
Total = table.Column(type: "NUMBER(10)", nullable: false, comment: "จำนวนทั้งหมด")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaManages", x => x.Id);
table.ForeignKey(
name: "FK_InsigniaManages_Insignias_InsigniaId",
column: x => x.InsigniaId,
principalTable: "Insignias",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "InsigniaNotes",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Name = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: true),
Year = table.Column(type: "NUMBER(10)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaNotes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "InsigniaPeriods",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Name = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: true, comment: "ชื่อรอบเสนอขอเครื่องราชฯ"),
Year = table.Column(type: "NUMBER(10)", nullable: false, comment: "ปี"),
StartDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "วันที่เริ่ม"),
EndDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "วันที่สิ้นสุด"),
Amount = table.Column(type: "NUMBER(10)", maxLength: 50, nullable: false, comment: "จำนวนวันแจ้งเตือนล่วงหน้า"),
Type = table.Column(type: "NVARCHAR2(10)", maxLength: 10, nullable: true, comment: "ประเภทการขอ"),
ReliefDocId = table.Column(type: "RAW(16)", nullable: true),
Round = table.Column(type: "NUMBER(10)", nullable: false, comment: "ราบการยื่นขอ"),
IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"),
IsLock = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการ Freez ข้อมูล")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaPeriods", x => x.Id);
table.ForeignKey(
name: "FK_InsigniaPeriods_Documents_ReliefDocId",
column: x => x.ReliefDocId,
principalTable: "Documents",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "MessageQueues",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
SenderSystem = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ส่งจากระบบงาน"),
Subject = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง"),
MessageContent = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "รายละเอียดข้อความ"),
MessagePayLoad = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สิ่งที่แนบมาด้วย"),
ReceiverUserId = table.Column(type: "RAW(16)", nullable: false, comment: "รหัสของผู้รับข้อความ"),
ReceiverEmailAddress = table.Column(type: "NVARCHAR2(500)", maxLength: 500, nullable: false, comment: "อีเมล์ของผู้รับ"),
IsSendEmail = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งอีเมลล์หรือไม่?"),
IsSendInbox = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งไปที่กล่องข้อความหรือไม่?"),
IsSendNotification = table.Column(type: "NUMBER(1)", nullable: false, comment: "ส่งการแจ้งเตือนหรือไม่?"),
IsSend = table.Column(type: "NUMBER(1)", nullable: false, comment: "ทำการส่งข้อความแล้วหรือยัง?")
},
constraints: table =>
{
table.PrimaryKey("PK_MessageQueues", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Notifications",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Body = table.Column(type: "NCLOB", nullable: false, comment: "รายละเอียดข้อความ"),
ReceiverUserId = table.Column(type: "RAW(16)", nullable: false, comment: "รหัสผู้รับข้อความ"),
Type = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ประเภทการแจ้งเตือน"),
Payload = table.Column(type: "NCLOB", nullable: false, comment: "สิงที่แนบมาด้วย"),
IsOpen = table.Column(type: "NUMBER(1)", nullable: false, comment: "เปิดอ่านแล้วหรือยัง"),
ReceiveDate = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "วันที่ได้รับ"),
OpenDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่เปิดอ่าน"),
DeleteDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่ลบข้อมูล")
},
constraints: table =>
{
table.PrimaryKey("PK_Notifications", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PlacementIsProperties",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Name = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อคุณสมบัติ"),
IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementIsProperties", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PlacementOfficers",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
Reason = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เหตุผล"),
PositionTypeOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท"),
PositionLevelOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ"),
PositionNumberOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่"),
AmountOld = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"),
OrganizationPositionOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สังกัด"),
Organization = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "หน่วยงานที่ช่วยราชการไป"),
DateStart = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "ตั้งแต่วันที่"),
DateEnd = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "ถึงวันที่"),
profileId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "profile Id"),
prefix = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คำนำหน้า"),
firstName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ"),
lastName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "นามสกุล"),
citizenId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขบัตรประชาชน"),
root = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน root"),
rootId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน root"),
rootShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน root"),
child1 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child1"),
child1Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child1"),
child1ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child1"),
child2 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child2"),
child2Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child2"),
child2ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child2"),
child3 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child3"),
child3Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child3"),
child3ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child3"),
child4 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child4"),
child4Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child4"),
child4ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child4"),
posMasterNo = table.Column(type: "NUMBER(10)", nullable: true, comment: "เลขที่ตำแหน่ง"),
position = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อตำแหน่งในสายงาน"),
posTypeId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id ประเภทตำแหน่ง"),
posTypeName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อประเภทตำแหน่ง"),
posLevelId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id ระดับตำแหน่ง"),
posLevelName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อระดับตำแหน่ง"),
Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะคำขอ"),
IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementOfficers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PlacementReceives",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
AvatarId = table.Column(type: "RAW(16)", nullable: true),
DateOfBirth = table.Column(type: "TIMESTAMP(7)", maxLength: 40, nullable: false, comment: "วันเกิด"),
GenderId = table.Column(type: "RAW(16)", nullable: true),
Nationality = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: true, comment: "สัญชาติ"),
Race = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ"),
ReligionId = table.Column(type: "RAW(16)", nullable: true),
BloodGroupId = table.Column(type: "RAW(16)", nullable: true),
RelationshipId = table.Column(type: "RAW(16)", nullable: true),
TelephoneNumber = table.Column(type: "NVARCHAR2(50)", maxLength: 50, nullable: true, comment: "เบอร์โทร"),
Status = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "สถานะคำขอ"),
Amount = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "เงินเดือน"),
RecruitDate = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "วันที่บรรจุ"),
Reason = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เหตุผลที่รับโอนราชการ"),
EducationOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "วุฒิ/สาขาเดิม"),
OrganizationPositionOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สังกัดเดิม"),
PositionTypeOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ตำแหน่งประเภท"),
PositionLevelOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ข้อมูลหน่วยงานเดิม ระดับ"),
PositionNumberOld = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เลขที่"),
AmountOld = table.Column(type: "BINARY_DOUBLE", nullable: true, comment: "ข้อมูลหน่วยงานเดิม เงินเดือน"),
profileId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "profile Id"),
prefix = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "คำนำหน้า"),
firstName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ"),
lastName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "นามสกุล"),
citizenId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "เลขบัตรประชาชน"),
root = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน root"),
rootId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน root"),
rootShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน root"),
child1 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child1"),
child1Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child1"),
child1ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child1"),
child2 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child2"),
child2Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child2"),
child2ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child2"),
child3 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child3"),
child3Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child3"),
child3ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child3"),
child4 = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อหน่วยงาน child4"),
child4Id = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id หน่วยงาน child4"),
child4ShortName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อย่อหน่วยงาน child4"),
node = table.Column(type: "NUMBER(10)", nullable: true, comment: "ระดับโครงสร้าง"),
nodeId = table.Column(type: "RAW(16)", nullable: true, comment: "id โครงสร้าง"),
posmasterId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id อัตรากำลัง"),
orgRevisionId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id revision"),
positionId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id ตำแหน่ง"),
positionField = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "สายงาน"),
posMasterNo = table.Column(type: "NUMBER(10)", nullable: true, comment: "เลขที่ตำแหน่ง"),
positionName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อตำแหน่งในสายงาน"),
posTypeId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id ประเภทตำแหน่ง"),
posTypeName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อประเภทตำแหน่ง"),
posLevelId = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "id ระดับตำแหน่ง"),
posLevelName = table.Column(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อระดับตำแหน่ง"),
IsActive = table.Column(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementReceives", x => x.Id);
table.ForeignKey(
name: "FK_PlacementReceives_BloodGroups_BloodGroupId",
column: x => x.BloodGroupId,
principalTable: "BloodGroups",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Documents_AvatarId",
column: x => x.AvatarId,
principalTable: "Documents",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Genders_GenderId",
column: x => x.GenderId,
principalTable: "Genders",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Relationships_RelationshipId",
column: x => x.RelationshipId,
principalTable: "Relationships",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Religions_ReligionId",
column: x => x.ReligionId,
principalTable: "Religions",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "PlacementRelocations",
columns: table => new
{
Id = table.Column(type: "RAW(16)", nullable: false, comment: "PrimaryKey"),
CreatedAt = table.Column(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
CreatedUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล"),
LastUpdatedAt = table.Column(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
LastUpdateUserId = table.Column(type: "NVARCHAR2(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด"),
CreatedFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
LastUpdateFullName = table.Column(type: "NVARCHAR2(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด"),
ProfileId = table.Column(type: "RAW(16)", nullable: false),
CitizenId = table.Column(type: "NVARCHAR2(20)", maxLength: 20, nullable: false, comment: "เลขประจำตัวประชาชน"),
PrefixId = table.Column(type: "RAW(16)", nullable: false),
Firstname = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ"),
Lastname = table.Column(type: "NVARCHAR2(2000)", nullable: false, comment: "นามสกุล"),
DateOfBirth = table.Column(type: "TIMESTAMP(7)", maxLength: 40, nullable: false, comment: "วันเกิด"),
GenderId = table.Column(type: "RAW(16)", nullable: true),
Nationality = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: true, comment: "สัญชาติ"),
Race = table.Column(type: "NVARCHAR2(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ"),
ReligionId = table.Column