hrms-api-backend/BMA.EHR.Infrastructure/Migrations/20230625113156_Init Project.cs
Suphonchai Phoonsawat 1ba2f2eec1 Restructure TAble
2023-06-25 18:36:02 +07:00

153 lines
11 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class InitProject : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "MD_BloodGroup_Drafts",
columns: table => new
{
Id = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"),
Name = table.Column<string>(type: "NVARCHAR2(2)", maxLength: 2, nullable: false, comment: "ชื่อหมู่โลหิต"),
IsPublished = table.Column<bool>(type: "NUMBER(1)", nullable: false, comment: "สถานะการเผยแพร่ข้อมูล"),
IsActive = table.Column<bool>(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"),
CreatedUserId = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"),
CreatedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
CreatedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
ModifiedUserId = table.Column<Guid>(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"),
ModifiedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"),
ModifiedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ")
},
constraints: table =>
{
table.PrimaryKey("PK_MD_BloodGroup_Drafts", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MD_BloodGroup_Histories",
columns: table => new
{
Id = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"),
Detail = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "รายละเอียดการแก้ไข"),
ObjectValue = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "เก็บ Object ที่มีการอัพเดตในระบบ"),
CreatedUserId = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"),
CreatedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
CreatedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
ModifiedUserId = table.Column<Guid>(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"),
ModifiedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"),
ModifiedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ")
},
constraints: table =>
{
table.PrimaryKey("PK_MD_BloodGroup_Histories", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MD_BloodGroups",
columns: table => new
{
Id = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"),
Name = table.Column<string>(type: "NVARCHAR2(2)", maxLength: 2, nullable: false, comment: "ชื่อหมู่โลหิต"),
IsActive = table.Column<bool>(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"),
CreatedUserId = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"),
CreatedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
CreatedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
ModifiedUserId = table.Column<Guid>(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"),
ModifiedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"),
ModifiedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ")
},
constraints: table =>
{
table.PrimaryKey("PK_MD_BloodGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MD_Prefix_Drafts",
columns: table => new
{
Id = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"),
Name = table.Column<string>(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "รายละเอียดคำนำหน้า"),
IsPublished = table.Column<bool>(type: "NUMBER(1)", nullable: false, comment: "สถานะการเผยแพร่ข้อมูล"),
IsActive = table.Column<bool>(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"),
CreatedUserId = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"),
CreatedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
CreatedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
ModifiedUserId = table.Column<Guid>(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"),
ModifiedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"),
ModifiedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ")
},
constraints: table =>
{
table.PrimaryKey("PK_MD_Prefix_Drafts", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MD_Prefix_Histories",
columns: table => new
{
Id = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"),
Detail = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "รายละเอียดการแก้ไข"),
ObjectValue = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "เก็บ Object ที่มีการอัพเดตในระบบ"),
CreatedUserId = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"),
CreatedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
CreatedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
ModifiedUserId = table.Column<Guid>(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"),
ModifiedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"),
ModifiedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ")
},
constraints: table =>
{
table.PrimaryKey("PK_MD_Prefix_Histories", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MD_Prefixes",
columns: table => new
{
Id = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "คีย์หลัก"),
Name = table.Column<string>(type: "NVARCHAR2(100)", maxLength: 100, nullable: false, comment: "รายละเอียดคำนำหน้า"),
IsActive = table.Column<bool>(type: "NUMBER(1)", nullable: false, comment: "สถานะการใช้งาน"),
CreatedUserId = table.Column<Guid>(type: "RAW(16)", nullable: false, comment: "User Id ที่สร้างข้อมูล"),
CreatedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล"),
CreatedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
ModifiedUserId = table.Column<Guid>(type: "RAW(16)", nullable: true, comment: "User Id ที่แก้ไขข้อมูล"),
ModifiedUserFullName = table.Column<string>(type: "NVARCHAR2(2000)", nullable: true, comment: "ชื่อ User ที่แก้ไขข้อมูล"),
ModifiedDate = table.Column<DateTime>(type: "TIMESTAMP(7)", nullable: true, comment: "แก้ไขข้อมูลเมื่อ")
},
constraints: table =>
{
table.PrimaryKey("PK_MD_Prefixes", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "MD_BloodGroup_Drafts");
migrationBuilder.DropTable(
name: "MD_BloodGroup_Histories");
migrationBuilder.DropTable(
name: "MD_BloodGroups");
migrationBuilder.DropTable(
name: "MD_Prefix_Drafts");
migrationBuilder.DropTable(
name: "MD_Prefix_Histories");
migrationBuilder.DropTable(
name: "MD_Prefixes");
}
}
}