add Oracle = Leave Service

This commit is contained in:
Suphonchai Phoonsawat 2024-05-03 13:35:36 +07:00
parent 18d75f4b04
commit f5558747d8
450 changed files with 882 additions and 2451185 deletions

View file

@ -1,40 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.7.201.7" />
<PackageReference Include="EPPlus" Version="6.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="MimeTypeMapOfficial" Version="1.0.17" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="7.21.9" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.7.201.7" />
<PackageReference Include="EPPlus" Version="6.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="MimeTypeMapOfficial" Version="1.0.17" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="7.21.9" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="7.21.13" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BMA.EHR.Application\BMA.EHR.Application.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BMA.EHR.Application\BMA.EHR.Application.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="SeedCommand.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="SeedCommand.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View file

@ -18,7 +18,7 @@ namespace BMA.EHR.Infrastructure
var connectionStringLeave = configuration.GetConnectionString("LeaveConnection");
services.AddDbContext<LeaveDbContext>(options =>
options.UseMySql(connectionStringLeave, ServerVersion.AutoDetect(connectionStringLeave),
options.UseOracle(connectionStringLeave,
b =>
{
b.MigrationsAssembly(typeof(LeaveDbContext).Assembly.FullName);
@ -41,7 +41,7 @@ namespace BMA.EHR.Infrastructure
var connectionStringDiscipline = configuration.GetConnectionString("DisciplineConnection");
services.AddDbContext<DisciplineDbContext>(options =>
options.UseMySql(connectionStringDiscipline, ServerVersion.AutoDetect(connectionStringDiscipline),
options.UseOracle(connectionStringDiscipline,
b =>
{
b.MigrationsAssembly(typeof(DisciplineDbContext).Assembly.FullName);
@ -64,7 +64,7 @@ namespace BMA.EHR.Infrastructure
var connectionString = configuration.GetConnectionString("DefaultConnection");
services.AddDbContext<ApplicationDBContext>(options =>
options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString),
options.UseOracle(connectionString,
b =>
{
b.MigrationsAssembly(typeof(ApplicationDBContext).Assembly.FullName);
@ -78,7 +78,7 @@ namespace BMA.EHR.Infrastructure
var connectionStringExam = configuration.GetConnectionString("ExamConnection");
services.AddDbContext<ApplicationDBExamContext>(options =>
options.UseMySql(connectionStringExam, ServerVersion.AutoDetect(connectionStringExam),
options.UseOracle(connectionStringExam,
b =>
{
b.MigrationsAssembly(typeof(ApplicationDBExamContext).Assembly.FullName);

View file

@ -1,26 +0,0 @@
// <auto-generated />
using BMA.EHR.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
[DbContext(typeof(ApplicationDBContext))]
[Migration("20230626063110_Init MetaData Table")]
partial class InitMetaDataTable
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
#pragma warning restore 612, 618
}
}
}

View file

@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class InitMetaDataTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View file

@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddExistDbtoProject : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View file

@ -1,46 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddDeploymentChannel : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DeploymentChannels",
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"),
IsSendInbox = table.Column<bool>(type: "tinyint(1)", nullable: false),
IsSendEmail = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DeploymentChannels", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DeploymentChannels");
}
}
}

View file

@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class testaddmigrationfromcli : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View file

@ -1,580 +0,0 @@
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");
}
}
}

View file

@ -1,92 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetablePlacementaddPlacementType : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "TypeExam",
table: "Placements");
migrationBuilder.AddColumn<Guid>(
name: "PlacementTypeId",
table: "Placements",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.CreateTable(
name: "PlacementTypes",
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_PlacementTypes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Placements_PlacementTypeId",
table: "Placements",
column: "PlacementTypeId");
migrationBuilder.AddForeignKey(
name: "FK_Placements_PlacementTypes_PlacementTypeId",
table: "Placements",
column: "PlacementTypeId",
principalTable: "PlacementTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Placements_PlacementTypes_PlacementTypeId",
table: "Placements");
migrationBuilder.DropTable(
name: "PlacementTypes");
migrationBuilder.DropIndex(
name: "IX_Placements_PlacementTypeId",
table: "Placements");
migrationBuilder.DropColumn(
name: "PlacementTypeId",
table: "Placements");
migrationBuilder.AddColumn<string>(
name: "TypeExam",
table: "Placements",
type: "longtext",
nullable: false,
comment: "ประเภทการสอบ")
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -1,124 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetablePlacementaddReportingDate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementProfiles_PlacementStatuses_PlacementStatusId",
table: "PlacementProfiles");
migrationBuilder.DropTable(
name: "PlacementStatuses");
migrationBuilder.RenameColumn(
name: "PlacementStatusId",
table: "PlacementProfiles",
newName: "GenderId");
migrationBuilder.RenameIndex(
name: "IX_PlacementProfiles_PlacementStatusId",
table: "PlacementProfiles",
newName: "IX_PlacementProfiles_GenderId");
migrationBuilder.AddColumn<bool>(
name: "IsRelief",
table: "PlacementProfiles",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "ผ่อนผัน");
migrationBuilder.AddColumn<string>(
name: "PlacementStatus",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "สถานะการบรรจุ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "ReportingDate",
table: "PlacementProfiles",
type: "datetime(6)",
nullable: true,
comment: "วันที่รายงานตัว");
migrationBuilder.AddForeignKey(
name: "FK_PlacementProfiles_Genders_GenderId",
table: "PlacementProfiles",
column: "GenderId",
principalTable: "Genders",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementProfiles_Genders_GenderId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "IsRelief",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "PlacementStatus",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "ReportingDate",
table: "PlacementProfiles");
migrationBuilder.RenameColumn(
name: "GenderId",
table: "PlacementProfiles",
newName: "PlacementStatusId");
migrationBuilder.RenameIndex(
name: "IX_PlacementProfiles_GenderId",
table: "PlacementProfiles",
newName: "IX_PlacementProfiles_PlacementStatusId");
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"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน"),
Name = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อสถานะบรรจุ")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementStatuses", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddForeignKey(
name: "FK_PlacementProfiles_PlacementStatuses_PlacementStatusId",
table: "PlacementProfiles",
column: "PlacementStatusId",
principalTable: "PlacementStatuses",
principalColumn: "Id");
}
}
}

View file

@ -1,50 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetablePlacementaddstartstatus : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "PlacementProfiles",
keyColumn: "PlacementStatus",
keyValue: null,
column: "PlacementStatus",
value: "");
migrationBuilder.AlterColumn<string>(
name: "PlacementStatus",
table: "PlacementProfiles",
type: "longtext",
nullable: false,
comment: "สถานะการบรรจุ",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "สถานะการบรรจุ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "PlacementStatus",
table: "PlacementProfiles",
type: "longtext",
nullable: true,
comment: "สถานะการบรรจุ",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "สถานะการบรรจุ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -1,185 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetablePlacementaddcertificate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PlacementCareers");
migrationBuilder.AddColumn<Guid>(
name: "BloodGroupId",
table: "PlacementProfiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<string>(
name: "Race",
table: "PlacementProfiles",
type: "varchar(40)",
maxLength: 40,
nullable: true,
comment: "เชื้อชาติ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<Guid>(
name: "ReligionId",
table: "PlacementProfiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateTable(
name: "PlacementCertificates",
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"),
CertificateNo = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true, comment: "เลขที่ใบอนุญาต")
.Annotation("MySql:CharSet", "utf8mb4"),
Issuer = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "หน่วยงานผู้ออกใบอนุญาต")
.Annotation("MySql:CharSet", "utf8mb4"),
IssueDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ออกใบอนุญาต"),
ExpireDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่หมดอายุ"),
CertificateType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "ชื่อใบอนุญาต")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementCertificates", x => x.Id);
table.ForeignKey(
name: "FK_PlacementCertificates_PlacementProfiles_PlacementProfileId",
column: x => x.PlacementProfileId,
principalTable: "PlacementProfiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_PlacementProfiles_BloodGroupId",
table: "PlacementProfiles",
column: "BloodGroupId");
migrationBuilder.CreateIndex(
name: "IX_PlacementProfiles_ReligionId",
table: "PlacementProfiles",
column: "ReligionId");
migrationBuilder.CreateIndex(
name: "IX_PlacementCertificates_PlacementProfileId",
table: "PlacementCertificates",
column: "PlacementProfileId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementProfiles_BloodGroups_BloodGroupId",
table: "PlacementProfiles",
column: "BloodGroupId",
principalTable: "BloodGroups",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementProfiles_Religions_ReligionId",
table: "PlacementProfiles",
column: "ReligionId",
principalTable: "Religions",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementProfiles_BloodGroups_BloodGroupId",
table: "PlacementProfiles");
migrationBuilder.DropForeignKey(
name: "FK_PlacementProfiles_Religions_ReligionId",
table: "PlacementProfiles");
migrationBuilder.DropTable(
name: "PlacementCertificates");
migrationBuilder.DropIndex(
name: "IX_PlacementProfiles_BloodGroupId",
table: "PlacementProfiles");
migrationBuilder.DropIndex(
name: "IX_PlacementProfiles_ReligionId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "BloodGroupId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "Race",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "ReligionId",
table: "PlacementProfiles");
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"),
DurationEnd = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "ระยะเวลาสิ้นสุด"),
DurationStart = 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"),
Reason = table.Column<string>(type: "longtext", nullable: false, comment: "เหตุผลที่ออก")
.Annotation("MySql:CharSet", "utf8mb4"),
Salary = table.Column<int>(type: "int", maxLength: 20, nullable: false, comment: "เงินเดือนสุดท้ายก่อนออก")
},
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.CreateIndex(
name: "IX_PlacementCareers_PlacementProfileId",
table: "PlacementCareers",
column: "PlacementProfileId");
}
}
}

View file

@ -1,282 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetableplacementEducationaddDegree : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DurationEnd",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "DurationStart",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Major",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Name",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Scores",
table: "PlacementEducations");
migrationBuilder.AddColumn<string>(
name: "Country",
table: "PlacementEducations",
type: "varchar(1000)",
maxLength: 1000,
nullable: true,
comment: "ประเทศ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Degree",
table: "PlacementEducations",
type: "varchar(200)",
maxLength: 200,
nullable: true,
comment: "วุฒิการศึกษา")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Duration",
table: "PlacementEducations",
type: "varchar(1000)",
maxLength: 1000,
nullable: true,
comment: "ระยะเวลา")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "DurationYear",
table: "PlacementEducations",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ระยะเวลาหลักสูตร");
migrationBuilder.AddColumn<DateTime>(
name: "EndDate",
table: "PlacementEducations",
type: "datetime(6)",
nullable: true,
comment: "ถึง");
migrationBuilder.AddColumn<string>(
name: "Field",
table: "PlacementEducations",
type: "varchar(200)",
maxLength: 200,
nullable: true,
comment: "สาขาวิชา/ทาง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "FinishDate",
table: "PlacementEducations",
type: "datetime(6)",
nullable: true,
comment: "วันที่สำเร็จการศึกษา");
migrationBuilder.AddColumn<string>(
name: "FundName",
table: "PlacementEducations",
type: "varchar(1000)",
maxLength: 1000,
nullable: true,
comment: "ทุน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Gpa",
table: "PlacementEducations",
type: "varchar(20)",
maxLength: 20,
nullable: true,
comment: "เกรดเฉลี่ย")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Institute",
table: "PlacementEducations",
type: "varchar(1000)",
maxLength: 1000,
nullable: true,
comment: "สถานศึกษา")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "IsDate",
table: "PlacementEducations",
type: "tinyint(1)",
nullable: true,
comment: "ประเภทช่วงเวลาการศึกษา");
migrationBuilder.AddColumn<bool>(
name: "IsEducation",
table: "PlacementEducations",
type: "tinyint(1)",
nullable: true,
comment: "เป็นวุฒิศึกษาในตำแหน่ง");
migrationBuilder.AddColumn<string>(
name: "Other",
table: "PlacementEducations",
type: "varchar(1000)",
maxLength: 1000,
nullable: true,
comment: "ข้อมูลการติดต่อ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<Guid>(
name: "PositionPathId",
table: "PlacementEducations",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<DateTime>(
name: "StartDate",
table: "PlacementEducations",
type: "datetime(6)",
nullable: true,
comment: "ตั้งแต่");
migrationBuilder.CreateIndex(
name: "IX_PlacementEducations_PositionPathId",
table: "PlacementEducations",
column: "PositionPathId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementEducations_PositionPaths_PositionPathId",
table: "PlacementEducations",
column: "PositionPathId",
principalTable: "PositionPaths",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementEducations_PositionPaths_PositionPathId",
table: "PlacementEducations");
migrationBuilder.DropIndex(
name: "IX_PlacementEducations_PositionPathId",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Country",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Degree",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Duration",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "DurationYear",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "EndDate",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Field",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "FinishDate",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "FundName",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Gpa",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Institute",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "IsDate",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "IsEducation",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "Other",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "PositionPathId",
table: "PlacementEducations");
migrationBuilder.DropColumn(
name: "StartDate",
table: "PlacementEducations");
migrationBuilder.AddColumn<DateTime>(
name: "DurationEnd",
table: "PlacementEducations",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
comment: "ระยะเวลาสิ้นสุด");
migrationBuilder.AddColumn<DateTime>(
name: "DurationStart",
table: "PlacementEducations",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
comment: "ระยะเวลาเริ่ม");
migrationBuilder.AddColumn<string>(
name: "Major",
table: "PlacementEducations",
type: "longtext",
nullable: false,
comment: "สาขาวิชา/วิชาเอก")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Name",
table: "PlacementEducations",
type: "longtext",
nullable: false,
comment: "ชื่อสถานศึกษา")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<float>(
name: "Scores",
table: "PlacementEducations",
type: "float",
maxLength: 10,
nullable: false,
defaultValue: 0f,
comment: "คะแนนเฉลี่ยตลอดหลักสูตร");
}
}
}

View file

@ -1,30 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetableprofileaddkeycloakId : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "KeycloakId",
table: "Profiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "KeycloakId",
table: "Profiles");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,57 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddMessageQueue : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "MessageQueues",
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"),
SenderSystem = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ส่งจากระบบงาน")
.Annotation("MySql:CharSet", "utf8mb4"),
Subject = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง")
.Annotation("MySql:CharSet", "utf8mb4"),
MessageContent = table.Column<string>(type: "longtext", nullable: false, comment: "รายละเอียดข้อความ")
.Annotation("MySql:CharSet", "utf8mb4"),
MessagePayLoad = table.Column<string>(type: "longtext", nullable: false, comment: "สิ่งที่แนบมาด้วย")
.Annotation("MySql:CharSet", "utf8mb4"),
ReceiverUserId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสของผู้รับข้อความ", collation: "ascii_general_ci"),
IsSendEmail = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ส่งอีเมลล์หรือไม่?"),
IsSendInbox = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ส่งไปที่กล่องข้อความหรือไม่?"),
IsSendNotification = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ส่งการแจ้งเตือนหรือไม่?"),
IsSend = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ทำการส่งข้อความแล้วหรือยัง?")
},
constraints: table =>
{
table.PrimaryKey("PK_MessageQueues", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "MessageQueues");
}
}
}

View file

@ -1,32 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddReceiverEmailtoMessageQueue : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ReceiverEmailAddress",
table: "MessageQueues",
type: "varchar(500)",
maxLength: 500,
nullable: false,
defaultValue: "",
comment: "อีเมล์ของผู้รับ")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ReceiverEmailAddress",
table: "MessageQueues");
}
}
}

View file

@ -1,306 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddtableOrganizationEmployees : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "OrganizationEmployees",
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"),
Agency = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConditionNote = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Department = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Government = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: true),
IsCondition = table.Column<bool>(type: "tinyint(1)", nullable: true),
IsDirector = table.Column<bool>(type: "tinyint(1)", nullable: true),
OrganizationUserNote = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Qualification = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Pile = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PosNo = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PositionCondition = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PositionMasterUserNote = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationOrder = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationFaxId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationLevelId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationOrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationTelExternalId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationTelInternalId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationTypeId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
PositionEmployeeStatusId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
PositionEmployeeLineId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
PositionEmployeePositionId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationAgencyId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationGovernmentAgencyId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationShortNameId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationEmployees", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationEmployees_OrganizationFaxs_OrganizationFaxId",
column: x => x.OrganizationFaxId,
principalTable: "OrganizationFaxs",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_OrganizationLevels_OrganizationLevelId",
column: x => x.OrganizationLevelId,
principalTable: "OrganizationLevels",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_OrganizationOrganizations_Organization~",
column: x => x.OrganizationOrganizationId,
principalTable: "OrganizationOrganizations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_OrganizationShortNames_OrganizationSho~",
column: x => x.OrganizationShortNameId,
principalTable: "OrganizationShortNames",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_OrganizationTelExternals_OrganizationT~",
column: x => x.OrganizationTelExternalId,
principalTable: "OrganizationTelExternals",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_OrganizationTelInternals_OrganizationT~",
column: x => x.OrganizationTelInternalId,
principalTable: "OrganizationTelInternals",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_OrganizationTypes_OrganizationTypeId",
column: x => x.OrganizationTypeId,
principalTable: "OrganizationTypes",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_Organizations_OrganizationAgencyId",
column: x => x.OrganizationAgencyId,
principalTable: "Organizations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_Organizations_OrganizationGovernmentAg~",
column: x => x.OrganizationGovernmentAgencyId,
principalTable: "Organizations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_PositionEmployeeLines_PositionEmployee~",
column: x => x.PositionEmployeeLineId,
principalTable: "PositionEmployeeLines",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_PositionEmployeePositions_PositionEmpl~",
column: x => x.PositionEmployeePositionId,
principalTable: "PositionEmployeePositions",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_PositionEmployeeStatuses_PositionEmplo~",
column: x => x.PositionEmployeeStatusId,
principalTable: "PositionEmployeeStatuses",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationEmployees_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OrganizationPositionEmployeeLevels",
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"),
OrganizationEmployeeId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
PositionEmployeeLevelId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationPositionEmployeeLevels", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationPositionEmployeeLevels_OrganizationEmployees_Org~",
column: x => x.OrganizationEmployeeId,
principalTable: "OrganizationEmployees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationPositionEmployeeLevels_PositionEmployeeLevels_Po~",
column: x => x.PositionEmployeeLevelId,
principalTable: "PositionEmployeeLevels",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "OrganizationPositionEmployeePositionSides",
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"),
OrganizationEmployeeId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
PositionEmployeePositionSideId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_OrganizationPositionEmployeePositionSides", x => x.Id);
table.ForeignKey(
name: "FK_OrganizationPositionEmployeePositionSides_OrganizationEmploy~",
column: x => x.OrganizationEmployeeId,
principalTable: "OrganizationEmployees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_OrganizationPositionEmployeePositionSides_PositionEmployeePo~",
column: x => x.PositionEmployeePositionSideId,
principalTable: "PositionEmployeePositionSides",
principalColumn: "Id");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationAgencyId",
table: "OrganizationEmployees",
column: "OrganizationAgencyId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationFaxId",
table: "OrganizationEmployees",
column: "OrganizationFaxId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationGovernmentAgencyId",
table: "OrganizationEmployees",
column: "OrganizationGovernmentAgencyId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationLevelId",
table: "OrganizationEmployees",
column: "OrganizationLevelId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationOrganizationId",
table: "OrganizationEmployees",
column: "OrganizationOrganizationId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationShortNameId",
table: "OrganizationEmployees",
column: "OrganizationShortNameId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationTelExternalId",
table: "OrganizationEmployees",
column: "OrganizationTelExternalId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationTelInternalId",
table: "OrganizationEmployees",
column: "OrganizationTelInternalId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_OrganizationTypeId",
table: "OrganizationEmployees",
column: "OrganizationTypeId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_PositionEmployeeLineId",
table: "OrganizationEmployees",
column: "PositionEmployeeLineId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_PositionEmployeePositionId",
table: "OrganizationEmployees",
column: "PositionEmployeePositionId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_PositionEmployeeStatusId",
table: "OrganizationEmployees",
column: "PositionEmployeeStatusId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationEmployees_ProfileId",
table: "OrganizationEmployees",
column: "ProfileId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationPositionEmployeeLevels_OrganizationEmployeeId",
table: "OrganizationPositionEmployeeLevels",
column: "OrganizationEmployeeId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationPositionEmployeeLevels_PositionEmployeeLevelId",
table: "OrganizationPositionEmployeeLevels",
column: "PositionEmployeeLevelId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationPositionEmployeePositionSides_OrganizationEmploy~",
table: "OrganizationPositionEmployeePositionSides",
column: "OrganizationEmployeeId");
migrationBuilder.CreateIndex(
name: "IX_OrganizationPositionEmployeePositionSides_PositionEmployeePo~",
table: "OrganizationPositionEmployeePositionSides",
column: "PositionEmployeePositionSideId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrganizationPositionEmployeeLevels");
migrationBuilder.DropTable(
name: "OrganizationPositionEmployeePositionSides");
migrationBuilder.DropTable(
name: "OrganizationEmployees");
}
}
}

View file

@ -1,198 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddPlacementCommandTableandCommandCoreTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CommandStatuses",
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: "varchar(100)", maxLength: 100, nullable: false, comment: "สถานะของคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_CommandStatuses", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "CommandTypes",
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: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
Category = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ประเภทคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_CommandTypes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "BaseCommand",
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"),
CommandNo = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false, comment: "เลขที่คำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
CommandYear = table.Column<string>(type: "varchar(4)", maxLength: 4, nullable: false, comment: "ปีที่ออกคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
CommandTypeId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสอ้างอิงประเภทคำสั่ง", collation: "ascii_general_ci"),
IssuerOrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสอ้างอิงหน่วยงานที่ออกคำสั่ง", collation: "ascii_general_ci"),
IssuerOrganizationName = table.Column<string>(type: "longtext", nullable: false, comment: "หน่วยงานที่ออกคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
CommandStatusId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสอ้างอิงสถานะคำสั่ง", collation: "ascii_general_ci"),
AuthorizedUserId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสอ้างอิงผู้มีอำนาจลงนาม", collation: "ascii_general_ci"),
AuthorizedUserFullName = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อผู้มีอำนาจลงนาม")
.Annotation("MySql:CharSet", "utf8mb4"),
Discriminator = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ExamRoundId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "อ้างอิงรอบการสอบ", collation: "ascii_general_ci"),
PositionName = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่งที่บรรจุ")
.Annotation("MySql:CharSet", "utf8mb4"),
ConclusionRegisterNo = table.Column<string>(type: "longtext", nullable: true, comment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")
.Annotation("MySql:CharSet", "utf8mb4"),
ConclusionRegisterDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)"),
ConclusionResultNo = table.Column<string>(type: "longtext", nullable: true, comment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")
.Annotation("MySql:CharSet", "utf8mb4"),
ConclusionResultDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)")
},
constraints: table =>
{
table.PrimaryKey("PK_BaseCommand", x => x.Id);
table.ForeignKey(
name: "FK_BaseCommand_CommandStatuses_CommandStatusId",
column: x => x.CommandStatusId,
principalTable: "CommandStatuses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_BaseCommand_CommandTypes_CommandTypeId",
column: x => x.CommandTypeId,
principalTable: "CommandTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "CommandDocuments",
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"),
Category = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภทเอกสาร")
.Annotation("MySql:CharSet", "utf8mb4"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CommandId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_CommandDocuments", x => x.Id);
table.ForeignKey(
name: "FK_CommandDocuments_BaseCommand_CommandId",
column: x => x.CommandId,
principalTable: "BaseCommand",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CommandDocuments_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_BaseCommand_CommandStatusId",
table: "BaseCommand",
column: "CommandStatusId");
migrationBuilder.CreateIndex(
name: "IX_BaseCommand_CommandTypeId",
table: "BaseCommand",
column: "CommandTypeId");
migrationBuilder.CreateIndex(
name: "IX_CommandDocuments_CommandId",
table: "CommandDocuments",
column: "CommandId");
migrationBuilder.CreateIndex(
name: "IX_CommandDocuments_DocumentId",
table: "CommandDocuments",
column: "DocumentId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CommandDocuments");
migrationBuilder.DropTable(
name: "BaseCommand");
migrationBuilder.DropTable(
name: "CommandStatuses");
migrationBuilder.DropTable(
name: "CommandTypes");
}
}
}

View file

@ -1,136 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class ChangeBaseCommandTableName : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_BaseCommand_CommandStatuses_CommandStatusId",
table: "BaseCommand");
migrationBuilder.DropForeignKey(
name: "FK_BaseCommand_CommandTypes_CommandTypeId",
table: "BaseCommand");
migrationBuilder.DropForeignKey(
name: "FK_CommandDocuments_BaseCommand_CommandId",
table: "CommandDocuments");
migrationBuilder.DropPrimaryKey(
name: "PK_BaseCommand",
table: "BaseCommand");
migrationBuilder.RenameTable(
name: "BaseCommand",
newName: "Command");
migrationBuilder.RenameIndex(
name: "IX_BaseCommand_CommandTypeId",
table: "Command",
newName: "IX_Command_CommandTypeId");
migrationBuilder.RenameIndex(
name: "IX_BaseCommand_CommandStatusId",
table: "Command",
newName: "IX_Command_CommandStatusId");
migrationBuilder.AddPrimaryKey(
name: "PK_Command",
table: "Command",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Command_CommandStatuses_CommandStatusId",
table: "Command",
column: "CommandStatusId",
principalTable: "CommandStatuses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Command_CommandTypes_CommandTypeId",
table: "Command",
column: "CommandTypeId",
principalTable: "CommandTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CommandDocuments_Command_CommandId",
table: "CommandDocuments",
column: "CommandId",
principalTable: "Command",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Command_CommandStatuses_CommandStatusId",
table: "Command");
migrationBuilder.DropForeignKey(
name: "FK_Command_CommandTypes_CommandTypeId",
table: "Command");
migrationBuilder.DropForeignKey(
name: "FK_CommandDocuments_Command_CommandId",
table: "CommandDocuments");
migrationBuilder.DropPrimaryKey(
name: "PK_Command",
table: "Command");
migrationBuilder.RenameTable(
name: "Command",
newName: "BaseCommand");
migrationBuilder.RenameIndex(
name: "IX_Command_CommandTypeId",
table: "BaseCommand",
newName: "IX_BaseCommand_CommandTypeId");
migrationBuilder.RenameIndex(
name: "IX_Command_CommandStatusId",
table: "BaseCommand",
newName: "IX_BaseCommand_CommandStatusId");
migrationBuilder.AddPrimaryKey(
name: "PK_BaseCommand",
table: "BaseCommand",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_BaseCommand_CommandStatuses_CommandStatusId",
table: "BaseCommand",
column: "CommandStatusId",
principalTable: "CommandStatuses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_BaseCommand_CommandTypes_CommandTypeId",
table: "BaseCommand",
column: "CommandTypeId",
principalTable: "CommandTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CommandDocuments_BaseCommand_CommandId",
table: "CommandDocuments",
column: "CommandId",
principalTable: "BaseCommand",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View file

@ -1,191 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetablePlacementProfileadddraft : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Draft",
table: "PlacementProfiles",
type: "tinyint(1)",
nullable: true,
comment: "ข้อมูลตำแหน่ง Draft");
migrationBuilder.CreateTable(
name: "InsigniaPeriods",
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: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Year = table.Column<int>(type: "int", nullable: false),
StartDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
EndDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Amount = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<string>(type: "varchar(10)", maxLength: 10, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaPeriods", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "InsigniaRequests",
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"),
RequestStatus = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RequestNote = table.Column<string>(type: "text", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PeriodId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrganizationOrganizationId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaRequests", x => x.Id);
table.ForeignKey(
name: "FK_InsigniaRequests_InsigniaPeriods_PeriodId",
column: x => x.PeriodId,
principalTable: "InsigniaPeriods",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_InsigniaRequests_OrganizationOrganizations_OrganizationOrgan~",
column: x => x.OrganizationOrganizationId,
principalTable: "OrganizationOrganizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "InsigniaRequestProfiles",
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"),
RequestDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Salary = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
IsApprove = table.Column<bool>(type: "tinyint(1)", nullable: false),
QualificationStatus = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DocumentStatus = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Note = table.Column<string>(type: "text", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Special = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
MatchingConditions = table.Column<string>(type: "text", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RequestInsigniaId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RequestId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_InsigniaRequestProfiles", x => x.Id);
table.ForeignKey(
name: "FK_InsigniaRequestProfiles_InsigniaRequests_RequestId",
column: x => x.RequestId,
principalTable: "InsigniaRequests",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_InsigniaRequestProfiles_Insignias_RequestInsigniaId",
column: x => x.RequestInsigniaId,
principalTable: "Insignias",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_InsigniaRequestProfiles_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_InsigniaRequestProfiles_ProfileId",
table: "InsigniaRequestProfiles",
column: "ProfileId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaRequestProfiles_RequestId",
table: "InsigniaRequestProfiles",
column: "RequestId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaRequestProfiles_RequestInsigniaId",
table: "InsigniaRequestProfiles",
column: "RequestInsigniaId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaRequests_OrganizationOrganizationId",
table: "InsigniaRequests",
column: "OrganizationOrganizationId");
migrationBuilder.CreateIndex(
name: "IX_InsigniaRequests_PeriodId",
table: "InsigniaRequests",
column: "PeriodId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InsigniaRequestProfiles");
migrationBuilder.DropTable(
name: "InsigniaRequests");
migrationBuilder.DropTable(
name: "InsigniaPeriods");
migrationBuilder.DropColumn(
name: "Draft",
table: "PlacementProfiles");
}
}
}

View file

@ -1,50 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class UpdatetablePlacementProfileaddpositioncandidate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "PositionCandidateId",
table: "PlacementProfiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_PlacementProfiles_PositionCandidateId",
table: "PlacementProfiles",
column: "PositionCandidateId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementProfiles_PositionPaths_PositionCandidateId",
table: "PlacementProfiles",
column: "PositionCandidateId",
principalTable: "PositionPaths",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementProfiles_PositionPaths_PositionCandidateId",
table: "PlacementProfiles");
migrationBuilder.DropIndex(
name: "IX_PlacementProfiles_PositionCandidateId",
table: "PlacementProfiles");
migrationBuilder.DropColumn(
name: "PositionCandidateId",
table: "PlacementProfiles");
}
}
}

View file

@ -1,314 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class ChangeCommandTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Command_CommandStatuses_CommandStatusId",
table: "Command");
migrationBuilder.DropForeignKey(
name: "FK_Command_CommandTypes_CommandTypeId",
table: "Command");
migrationBuilder.DropForeignKey(
name: "FK_CommandDocuments_Command_CommandId",
table: "CommandDocuments");
migrationBuilder.DropPrimaryKey(
name: "PK_Command",
table: "Command");
migrationBuilder.DropColumn(
name: "Discriminator",
table: "Command");
migrationBuilder.RenameTable(
name: "Command",
newName: "Commands");
migrationBuilder.RenameIndex(
name: "IX_Command_CommandTypeId",
table: "Commands",
newName: "IX_Commands_CommandTypeId");
migrationBuilder.RenameIndex(
name: "IX_Command_CommandStatusId",
table: "Commands",
newName: "IX_Commands_CommandStatusId");
migrationBuilder.UpdateData(
table: "Commands",
keyColumn: "PositionName",
keyValue: null,
column: "PositionName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "PositionName",
table: "Commands",
type: "longtext",
nullable: false,
comment: "ตำแหน่งที่บรรจุ",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "ตำแหน่งที่บรรจุ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<Guid>(
name: "ExamRoundId",
table: "Commands",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
comment: "อ้างอิงรอบการสอบ",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "อ้างอิงรอบการสอบ")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Commands",
keyColumn: "ConclusionResultNo",
keyValue: null,
column: "ConclusionResultNo",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ConclusionResultNo",
table: "Commands",
type: "longtext",
nullable: false,
comment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionResultDate",
table: "Commands",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
comment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)");
migrationBuilder.UpdateData(
table: "Commands",
keyColumn: "ConclusionRegisterNo",
keyValue: null,
column: "ConclusionRegisterNo",
value: "");
migrationBuilder.AlterColumn<string>(
name: "ConclusionRegisterNo",
table: "Commands",
type: "longtext",
nullable: false,
comment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionRegisterDate",
table: "Commands",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
comment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldNullable: true,
oldComment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)");
migrationBuilder.AddPrimaryKey(
name: "PK_Commands",
table: "Commands",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_CommandDocuments_Commands_CommandId",
table: "CommandDocuments",
column: "CommandId",
principalTable: "Commands",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Commands_CommandStatuses_CommandStatusId",
table: "Commands",
column: "CommandStatusId",
principalTable: "CommandStatuses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Commands_CommandTypes_CommandTypeId",
table: "Commands",
column: "CommandTypeId",
principalTable: "CommandTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_CommandDocuments_Commands_CommandId",
table: "CommandDocuments");
migrationBuilder.DropForeignKey(
name: "FK_Commands_CommandStatuses_CommandStatusId",
table: "Commands");
migrationBuilder.DropForeignKey(
name: "FK_Commands_CommandTypes_CommandTypeId",
table: "Commands");
migrationBuilder.DropPrimaryKey(
name: "PK_Commands",
table: "Commands");
migrationBuilder.RenameTable(
name: "Commands",
newName: "Command");
migrationBuilder.RenameIndex(
name: "IX_Commands_CommandTypeId",
table: "Command",
newName: "IX_Command_CommandTypeId");
migrationBuilder.RenameIndex(
name: "IX_Commands_CommandStatusId",
table: "Command",
newName: "IX_Command_CommandStatusId");
migrationBuilder.AlterColumn<string>(
name: "PositionName",
table: "Command",
type: "longtext",
nullable: true,
comment: "ตำแหน่งที่บรรจุ",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ตำแหน่งที่บรรจุ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<Guid>(
name: "ExamRoundId",
table: "Command",
type: "char(36)",
nullable: true,
comment: "อ้างอิงรอบการสอบ",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldComment: "อ้างอิงรอบการสอบ")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<string>(
name: "ConclusionResultNo",
table: "Command",
type: "longtext",
nullable: true,
comment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "มติ กก. ครั้งที่ (เรื่อง ผลการสอบแข่งขัน)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionResultDate",
table: "Command",
type: "datetime(6)",
nullable: true,
comment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldComment: "ลงวันที่ (เรื่อง ผลการสอบแข่งขัน)");
migrationBuilder.AlterColumn<string>(
name: "ConclusionRegisterNo",
table: "Command",
type: "longtext",
nullable: true,
comment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "มติ กก. ครั้งที่ (เรื่อง รับสมัครสอบฯ)")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "ConclusionRegisterDate",
table: "Command",
type: "datetime(6)",
nullable: true,
comment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)",
oldClrType: typeof(DateTime),
oldType: "datetime(6)",
oldComment: "ลงวันที่ (เรื่อง รับสมัครสอบฯ)");
migrationBuilder.AddColumn<string>(
name: "Discriminator",
table: "Command",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddPrimaryKey(
name: "PK_Command",
table: "Command",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Command_CommandStatuses_CommandStatusId",
table: "Command",
column: "CommandStatusId",
principalTable: "CommandStatuses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Command_CommandTypes_CommandTypeId",
table: "Command",
column: "CommandTypeId",
principalTable: "CommandTypes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CommandDocuments_Command_CommandId",
table: "CommandDocuments",
column: "CommandId",
principalTable: "Command",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View file

@ -1,55 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addfieldtoCommandTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CommandAffectDate",
table: "Commands",
type: "datetime(6)",
nullable: true,
comment: "วันที่คำสั่งมีผล");
migrationBuilder.AddColumn<DateTime>(
name: "CommandExcecuteDate",
table: "Commands",
type: "datetime(6)",
nullable: true,
comment: "วันที่ออกคำสั่ง");
migrationBuilder.AddColumn<string>(
name: "CommandSubject",
table: "Commands",
type: "varchar(500)",
maxLength: 500,
nullable: false,
defaultValue: "",
comment: "คำสั่งเรื่อง")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CommandAffectDate",
table: "Commands");
migrationBuilder.DropColumn(
name: "CommandExcecuteDate",
table: "Commands");
migrationBuilder.DropColumn(
name: "CommandSubject",
table: "Commands");
}
}
}

View file

@ -1,30 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addSequencetoCommandTypeTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Sequence",
table: "CommandTypes",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ลำดับการทำงาน");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Sequence",
table: "CommandTypes");
}
}
}

View file

@ -1,42 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class RemoveSequencefromCommandTypeTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Sequence",
table: "CommandTypes");
migrationBuilder.AddColumn<int>(
name: "Sequence",
table: "CommandStatuses",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ลำดับการทำงาน");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Sequence",
table: "CommandStatuses");
migrationBuilder.AddColumn<int>(
name: "Sequence",
table: "CommandTypes",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ลำดับการทำงาน");
}
}
}

View file

@ -1,30 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddAuthorizedPositiontoCommandTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "AuthorizedPosition",
table: "Commands",
type: "longtext",
nullable: false,
comment: "ตำแหน่งผู้มีอำนาจลงนาม")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AuthorizedPosition",
table: "Commands");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,578 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddTableretire : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_InsigniaRequests_OrganizationOrganizations_OrganizationOrgan~",
table: "InsigniaRequests");
migrationBuilder.DropColumn(
name: "PosNo",
table: "Profiles");
migrationBuilder.DropColumn(
name: "Position",
table: "Profiles");
migrationBuilder.DropColumn(
name: "PositionLevel",
table: "Profiles");
migrationBuilder.DropColumn(
name: "PositionType",
table: "Profiles");
migrationBuilder.DropColumn(
name: "Insignia",
table: "ProfileInsignias");
migrationBuilder.DropColumn(
name: "Number",
table: "PlacementProfiles");
migrationBuilder.RenameColumn(
name: "OrganizationOrganizationId",
table: "InsigniaRequests",
newName: "OrganizationId");
migrationBuilder.RenameIndex(
name: "IX_InsigniaRequests_OrganizationOrganizationId",
table: "InsigniaRequests",
newName: "IX_InsigniaRequests_OrganizationId");
migrationBuilder.AlterColumn<Guid>(
name: "PositionLevelId",
table: "ProfileSalaries",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "Id ระดับ")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddColumn<int>(
name: "Order",
table: "ProfileSalaries",
type: "int",
nullable: true,
comment: "ลำดับ");
migrationBuilder.AlterColumn<Guid>(
name: "PrefixId",
table: "Profiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "Id คำนำหน้า")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PositionTypeId",
table: "Profiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "Id ประเภทตำแหน่ง")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PositionLevelId",
table: "Profiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: " Id ระดับ")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PositionId",
table: "Profiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "Id ตำแหน่ง")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PosNoId",
table: "Profiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "Id เลขที่ตำแหน่ง")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "GenderId",
table: "Profiles",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true,
oldComment: "Id เพศ")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "Id",
table: "Profiles",
type: "char(36)",
nullable: false,
comment: "PrimaryKey",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.Annotation("Relational:ColumnOrder", 0)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.CreateTable(
name: "Retirements",
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"),
Round = table.Column<int>(type: "int", nullable: false, comment: "ครั้งที่"),
Type = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภท")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Retirements", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RetirementProfiles",
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"),
Order = table.Column<int>(type: "int", nullable: false, comment: "ลำดับที่"),
Reason = table.Column<string>(type: "longtext", nullable: false, comment: "เหตุผล")
.Annotation("MySql:CharSet", "utf8mb4"),
Remove = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ลบออกจากเกษียญ"),
RetirementId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementProfiles", x => x.Id);
table.ForeignKey(
name: "FK_RetirementProfiles_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RetirementProfiles_Retirements_RetirementId",
column: x => x.RetirementId,
principalTable: "Retirements",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_ProfileSalaries_PositionLevelId",
table: "ProfileSalaries",
column: "PositionLevelId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_GenderId",
table: "Profiles",
column: "GenderId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_PositionId",
table: "Profiles",
column: "PositionId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_PositionLevelId",
table: "Profiles",
column: "PositionLevelId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_PositionTypeId",
table: "Profiles",
column: "PositionTypeId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_PosNoId",
table: "Profiles",
column: "PosNoId");
migrationBuilder.CreateIndex(
name: "IX_Profiles_PrefixId",
table: "Profiles",
column: "PrefixId");
migrationBuilder.CreateIndex(
name: "IX_ProfileInsignias_InsigniaId",
table: "ProfileInsignias",
column: "InsigniaId");
migrationBuilder.CreateIndex(
name: "IX_RetirementProfiles_ProfileId",
table: "RetirementProfiles",
column: "ProfileId");
migrationBuilder.CreateIndex(
name: "IX_RetirementProfiles_RetirementId",
table: "RetirementProfiles",
column: "RetirementId");
migrationBuilder.AddForeignKey(
name: "FK_InsigniaRequests_Organizations_OrganizationId",
table: "InsigniaRequests",
column: "OrganizationId",
principalTable: "Organizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ProfileInsignias_Insignias_InsigniaId",
table: "ProfileInsignias",
column: "InsigniaId",
principalTable: "Insignias",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Profiles_Genders_GenderId",
table: "Profiles",
column: "GenderId",
principalTable: "Genders",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Profiles_PositionLevels_PositionLevelId",
table: "Profiles",
column: "PositionLevelId",
principalTable: "PositionLevels",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Profiles_PositionNumbers_PosNoId",
table: "Profiles",
column: "PosNoId",
principalTable: "PositionNumbers",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Profiles_PositionPaths_PositionId",
table: "Profiles",
column: "PositionId",
principalTable: "PositionPaths",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Profiles_PositionTypes_PositionTypeId",
table: "Profiles",
column: "PositionTypeId",
principalTable: "PositionTypes",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Profiles_Prefixes_PrefixId",
table: "Profiles",
column: "PrefixId",
principalTable: "Prefixes",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_ProfileSalaries_PositionLevels_PositionLevelId",
table: "ProfileSalaries",
column: "PositionLevelId",
principalTable: "PositionLevels",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_InsigniaRequests_Organizations_OrganizationId",
table: "InsigniaRequests");
migrationBuilder.DropForeignKey(
name: "FK_ProfileInsignias_Insignias_InsigniaId",
table: "ProfileInsignias");
migrationBuilder.DropForeignKey(
name: "FK_Profiles_Genders_GenderId",
table: "Profiles");
migrationBuilder.DropForeignKey(
name: "FK_Profiles_PositionLevels_PositionLevelId",
table: "Profiles");
migrationBuilder.DropForeignKey(
name: "FK_Profiles_PositionNumbers_PosNoId",
table: "Profiles");
migrationBuilder.DropForeignKey(
name: "FK_Profiles_PositionPaths_PositionId",
table: "Profiles");
migrationBuilder.DropForeignKey(
name: "FK_Profiles_PositionTypes_PositionTypeId",
table: "Profiles");
migrationBuilder.DropForeignKey(
name: "FK_Profiles_Prefixes_PrefixId",
table: "Profiles");
migrationBuilder.DropForeignKey(
name: "FK_ProfileSalaries_PositionLevels_PositionLevelId",
table: "ProfileSalaries");
migrationBuilder.DropTable(
name: "RetirementProfiles");
migrationBuilder.DropTable(
name: "Retirements");
migrationBuilder.DropIndex(
name: "IX_ProfileSalaries_PositionLevelId",
table: "ProfileSalaries");
migrationBuilder.DropIndex(
name: "IX_Profiles_GenderId",
table: "Profiles");
migrationBuilder.DropIndex(
name: "IX_Profiles_PositionId",
table: "Profiles");
migrationBuilder.DropIndex(
name: "IX_Profiles_PositionLevelId",
table: "Profiles");
migrationBuilder.DropIndex(
name: "IX_Profiles_PositionTypeId",
table: "Profiles");
migrationBuilder.DropIndex(
name: "IX_Profiles_PosNoId",
table: "Profiles");
migrationBuilder.DropIndex(
name: "IX_Profiles_PrefixId",
table: "Profiles");
migrationBuilder.DropIndex(
name: "IX_ProfileInsignias_InsigniaId",
table: "ProfileInsignias");
migrationBuilder.DropColumn(
name: "Order",
table: "ProfileSalaries");
migrationBuilder.RenameColumn(
name: "OrganizationId",
table: "InsigniaRequests",
newName: "OrganizationOrganizationId");
migrationBuilder.RenameIndex(
name: "IX_InsigniaRequests_OrganizationId",
table: "InsigniaRequests",
newName: "IX_InsigniaRequests_OrganizationOrganizationId");
migrationBuilder.AlterColumn<Guid>(
name: "PositionLevelId",
table: "ProfileSalaries",
type: "char(36)",
nullable: true,
comment: "Id ระดับ",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PrefixId",
table: "Profiles",
type: "char(36)",
nullable: true,
comment: "Id คำนำหน้า",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PositionTypeId",
table: "Profiles",
type: "char(36)",
nullable: true,
comment: "Id ประเภทตำแหน่ง",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PositionLevelId",
table: "Profiles",
type: "char(36)",
nullable: true,
comment: " Id ระดับ",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PositionId",
table: "Profiles",
type: "char(36)",
nullable: true,
comment: "Id ตำแหน่ง",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "PosNoId",
table: "Profiles",
type: "char(36)",
nullable: true,
comment: "Id เลขที่ตำแหน่ง",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "GenderId",
table: "Profiles",
type: "char(36)",
nullable: true,
comment: "Id เพศ",
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AlterColumn<Guid>(
name: "Id",
table: "Profiles",
type: "char(36)",
nullable: false,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldComment: "PrimaryKey")
.OldAnnotation("Relational:Collation", "ascii_general_ci")
.OldAnnotation("Relational:ColumnOrder", 0);
migrationBuilder.AddColumn<string>(
name: "PosNo",
table: "Profiles",
type: "longtext",
nullable: true,
comment: "เลขที่ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Position",
table: "Profiles",
type: "longtext",
nullable: true,
comment: "ตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionLevel",
table: "Profiles",
type: "longtext",
nullable: true,
comment: "ระดับ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PositionType",
table: "Profiles",
type: "longtext",
nullable: true,
comment: "ประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Insignia",
table: "ProfileInsignias",
type: "longtext",
nullable: true,
comment: "ชื่อเครื่องราชฯ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "Number",
table: "PlacementProfiles",
type: "int",
nullable: true,
comment: "ลำดับที่สอบได้");
migrationBuilder.AddForeignKey(
name: "FK_InsigniaRequests_OrganizationOrganizations_OrganizationOrgan~",
table: "InsigniaRequests",
column: "OrganizationOrganizationId",
principalTable: "OrganizationOrganizations",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View file

@ -1,119 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updateTableretiretoRetirementPeriod : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RetirementProfiles_Retirements_RetirementId",
table: "RetirementProfiles");
migrationBuilder.DropTable(
name: "Retirements");
migrationBuilder.RenameColumn(
name: "RetirementId",
table: "RetirementProfiles",
newName: "RetirementPeriodId");
migrationBuilder.RenameIndex(
name: "IX_RetirementProfiles_RetirementId",
table: "RetirementProfiles",
newName: "IX_RetirementProfiles_RetirementPeriodId");
migrationBuilder.CreateTable(
name: "RetirementPeriods",
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"),
Round = table.Column<int>(type: "int", nullable: false, comment: "ครั้งที่"),
Type = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภท")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementPeriods", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddForeignKey(
name: "FK_RetirementProfiles_RetirementPeriods_RetirementPeriodId",
table: "RetirementProfiles",
column: "RetirementPeriodId",
principalTable: "RetirementPeriods",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RetirementProfiles_RetirementPeriods_RetirementPeriodId",
table: "RetirementProfiles");
migrationBuilder.DropTable(
name: "RetirementPeriods");
migrationBuilder.RenameColumn(
name: "RetirementPeriodId",
table: "RetirementProfiles",
newName: "RetirementId");
migrationBuilder.RenameIndex(
name: "IX_RetirementProfiles_RetirementPeriodId",
table: "RetirementProfiles",
newName: "IX_RetirementProfiles_RetirementId");
migrationBuilder.CreateTable(
name: "Retirements",
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"),
Round = table.Column<int>(type: "int", nullable: false, comment: "ครั้งที่"),
Type = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภท")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Retirements", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddForeignKey(
name: "FK_RetirementProfiles_Retirements_RetirementId",
table: "RetirementProfiles",
column: "RetirementId",
principalTable: "Retirements",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View file

@ -1,76 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updateTableretireaddyear : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Remove",
table: "RetirementProfiles",
type: "longtext",
nullable: false,
comment: "ลบออกจากเกษียญ",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldComment: "ลบออกจากเกษียญ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "Year",
table: "RetirementPeriods",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ปีงบประมาณ");
// migrationBuilder.AddColumn<DateTime>(
// name: "RefCommandDate",
// table: "ProfileInsignias",
// type: "datetime(6)",
// nullable: true,
// comment: "เอกสารอ้างอิง (ลงวันที่)");
// migrationBuilder.AddColumn<string>(
// name: "RefCommandNo",
// table: "ProfileInsignias",
// type: "longtext",
// nullable: true,
// comment: "เอกสารอ้างอิง (เลขที่คำสั่ง)")
// .Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Year",
table: "RetirementPeriods");
// migrationBuilder.DropColumn(
// name: "RefCommandDate",
// table: "ProfileInsignias");
// migrationBuilder.DropColumn(
// name: "RefCommandNo",
// table: "ProfileInsignias");
migrationBuilder.AlterColumn<bool>(
name: "Remove",
table: "RetirementProfiles",
type: "tinyint(1)",
nullable: false,
comment: "ลบออกจากเกษียญ",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "ลบออกจากเกษียญ")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -1,84 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updateTableplacementExamNumbernullable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "ExamRound",
table: "PlacementProfiles",
type: "int",
nullable: true,
comment: "จำนวนครั้งที่สมัครสอบ",
oldClrType: typeof(int),
oldType: "int",
oldComment: "จำนวนครั้งที่สมัครสอบ");
migrationBuilder.AlterColumn<int>(
name: "ExamNumber",
table: "PlacementProfiles",
type: "int",
nullable: true,
comment: "ลำดับที่สอบได้",
oldClrType: typeof(int),
oldType: "int",
oldComment: "ลำดับที่สอบได้");
migrationBuilder.AlterColumn<int>(
name: "DurationYear",
table: "PlacementEducations",
type: "int",
nullable: true,
comment: "ระยะเวลาหลักสูตร",
oldClrType: typeof(int),
oldType: "int",
oldComment: "ระยะเวลาหลักสูตร");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "ExamRound",
table: "PlacementProfiles",
type: "int",
nullable: false,
defaultValue: 0,
comment: "จำนวนครั้งที่สมัครสอบ",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "จำนวนครั้งที่สมัครสอบ");
migrationBuilder.AlterColumn<int>(
name: "ExamNumber",
table: "PlacementProfiles",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ลำดับที่สอบได้",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "ลำดับที่สอบได้");
migrationBuilder.AlterColumn<int>(
name: "DurationYear",
table: "PlacementEducations",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ระยะเวลาหลักสูตร",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "ระยะเวลาหลักสูตร");
}
}
}

View file

@ -1,78 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updateTableplacementprofilemobolelimit200 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Telephone",
table: "PlacementProfiles",
type: "varchar(200)",
maxLength: 200,
nullable: true,
comment: "โทรศัพท์",
oldClrType: typeof(string),
oldType: "varchar(20)",
oldMaxLength: 20,
oldNullable: true,
oldComment: "โทรศัพท์")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "MobilePhone",
table: "PlacementProfiles",
type: "varchar(200)",
maxLength: 200,
nullable: true,
comment: "โทรศัพท์มือถือ",
oldClrType: typeof(string),
oldType: "varchar(20)",
oldMaxLength: 20,
oldNullable: true,
oldComment: "โทรศัพท์มือถือ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Telephone",
table: "PlacementProfiles",
type: "varchar(20)",
maxLength: 20,
nullable: true,
comment: "โทรศัพท์",
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true,
oldComment: "โทรศัพท์")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "MobilePhone",
table: "PlacementProfiles",
type: "varchar(20)",
maxLength: 20,
nullable: true,
comment: "โทรศัพท์มือถือ",
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true,
oldComment: "โทรศัพท์มือถือ")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -1,48 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updateTableplacementprofilemobilelimit200 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "OccupationTelephone",
table: "PlacementProfiles",
type: "varchar(200)",
maxLength: 200,
nullable: true,
comment: "โทรศัพท์ บริษัท",
oldClrType: typeof(string),
oldType: "varchar(20)",
oldMaxLength: 20,
oldNullable: true,
oldComment: "โทรศัพท์ บริษัท")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "OccupationTelephone",
table: "PlacementProfiles",
type: "varchar(20)",
maxLength: 20,
nullable: true,
comment: "โทรศัพท์ บริษัท",
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true,
oldComment: "โทรศัพท์ บริษัท")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -1,109 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddCommandDeployandReceiver : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CommandDeployments",
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"),
CommandId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสอ้างอิงคำสั่ง", collation: "ascii_general_ci"),
ReceiveUserId = table.Column<string>(type: "longtext", nullable: false, comment: "รหัสอ้างอิงผู้ใช้งานระบบ")
.Annotation("MySql:CharSet", "utf8mb4"),
IsSendMail = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ส่งอีเมล์หรือไม่?"),
IsSendInbox = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ส่งกล่องข้อความหรือไม่?"),
IsSendNotification = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "ส่งแจ้งเตือนหรือไม่?")
},
constraints: table =>
{
table.PrimaryKey("PK_CommandDeployments", x => x.Id);
table.ForeignKey(
name: "FK_CommandDeployments_Commands_CommandId",
column: x => x.CommandId,
principalTable: "Commands",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "CommandReceivers",
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"),
CommandId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสอ้างอิงคำสั่ง", collation: "ascii_general_ci"),
Sequence = table.Column<int>(type: "int", nullable: false, comment: "ลำดับในบัญชีแนบท้าย"),
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: false, comment: "เลขประจำตัวประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
Prefix = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "คำนำหน้านาม")
.Annotation("MySql:CharSet", "utf8mb4"),
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
Comment = table.Column<string>(type: "text", nullable: false, comment: "หมายเหตุ")
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_CommandReceivers", x => x.Id);
table.ForeignKey(
name: "FK_CommandReceivers_Commands_CommandId",
column: x => x.CommandId,
principalTable: "Commands",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_CommandDeployments_CommandId",
table: "CommandDeployments",
column: "CommandId");
migrationBuilder.CreateIndex(
name: "IX_CommandReceivers_CommandId",
table: "CommandReceivers",
column: "CommandId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CommandDeployments");
migrationBuilder.DropTable(
name: "CommandReceivers");
}
}
}

View file

@ -1,278 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updateTablepositionpathaddorder : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "PositionTypes",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อประเภทตำแหน่ง",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "PositionTypes",
type: "tinyint(1)",
nullable: false,
comment: "สถานะการใช้งาน",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldComment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AddColumn<int>(
name: "Order",
table: "PositionTypes",
type: "int",
nullable: true,
comment: "ลำดับ")
.Annotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<string>(
name: "ShortName",
table: "PositionLevels",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อย่อระดับตำแหน่ง",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อย่อระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "PositionLevels",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อระดับตำแหน่ง",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<int>(
name: "Level",
table: "PositionLevels",
type: "int",
nullable: false,
comment: "ลำดับชั้นของระดับตำแหน่ง",
oldClrType: typeof(int),
oldType: "int",
oldComment: "ลำดับชั้นของระดับตำแหน่ง")
.Annotation("Relational:ColumnOrder", 4)
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "PositionLevels",
type: "tinyint(1)",
nullable: false,
comment: "สถานะการใช้งาน",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldComment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 5)
.OldAnnotation("Relational:ColumnOrder", 4);
migrationBuilder.AddColumn<int>(
name: "Order",
table: "PositionLevels",
type: "int",
nullable: true,
comment: "ลำดับ")
.Annotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "PositionEmployeeLevels",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "PositionEmployeeLevels",
type: "tinyint(1)",
nullable: false,
comment: "สถานะการใช้งาน",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldComment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AddColumn<int>(
name: "Order",
table: "PositionEmployeeLevels",
type: "int",
nullable: true,
comment: "ลำดับ")
.Annotation("Relational:ColumnOrder", 1);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Order",
table: "PositionTypes");
migrationBuilder.DropColumn(
name: "Order",
table: "PositionLevels");
migrationBuilder.DropColumn(
name: "Order",
table: "PositionEmployeeLevels");
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "PositionTypes",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อประเภทตำแหน่ง",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อประเภทตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 1)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "PositionTypes",
type: "tinyint(1)",
nullable: false,
comment: "สถานะการใช้งาน",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldComment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<string>(
name: "ShortName",
table: "PositionLevels",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อย่อระดับตำแหน่ง",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อย่อระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 3);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "PositionLevels",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อระดับตำแหน่ง",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อระดับตำแหน่ง")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 1)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<int>(
name: "Level",
table: "PositionLevels",
type: "int",
nullable: false,
comment: "ลำดับชั้นของระดับตำแหน่ง",
oldClrType: typeof(int),
oldType: "int",
oldComment: "ลำดับชั้นของระดับตำแหน่ง")
.Annotation("Relational:ColumnOrder", 3)
.OldAnnotation("Relational:ColumnOrder", 4);
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "PositionLevels",
type: "tinyint(1)",
nullable: false,
comment: "สถานะการใช้งาน",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldComment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 4)
.OldAnnotation("Relational:ColumnOrder", 5);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "PositionEmployeeLevels",
type: "varchar(100)",
maxLength: 100,
nullable: false,
comment: "ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ",
oldClrType: typeof(string),
oldType: "varchar(100)",
oldMaxLength: 100,
oldComment: "ชื่อระดับชั้นงานข้อมูลตำแหน่งของลูกจ้างกรุงเทพ")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:ColumnOrder", 1)
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:ColumnOrder", 2);
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "PositionEmployeeLevels",
type: "tinyint(1)",
nullable: false,
comment: "สถานะการใช้งาน",
oldClrType: typeof(bool),
oldType: "tinyint(1)",
oldComment: "สถานะการใช้งาน")
.Annotation("Relational:ColumnOrder", 2)
.OldAnnotation("Relational:ColumnOrder", 3);
}
}
}

View file

@ -1,32 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddOwnerGovIdtoCommandTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "OwnerGovId",
table: "Commands",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
comment: "รหัสส่วนราชการผู้ออกคำสั่ง",
collation: "ascii_general_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OwnerGovId",
table: "Commands");
}
}
}

View file

@ -1,30 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddCommandCodetoCommandTypeTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CommandCode",
table: "CommandTypes",
type: "longtext",
nullable: false,
comment: "รหัสของประเภทคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CommandCode",
table: "CommandTypes");
}
}
}

View file

@ -1,31 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddRefToPlacementProfiletoCommandReceiverTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "RefPlacementProfileId",
table: "CommandReceivers",
type: "char(36)",
nullable: true,
comment: "รหัสอ้างอิงไปยังข้อมูลผู้บรรจุ",
collation: "ascii_general_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RefPlacementProfileId",
table: "CommandReceivers");
}
}
}

View file

@ -1,129 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddFieldtoCommandDeploymentTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "ExamRoundId",
table: "Commands",
newName: "PlacementId");
migrationBuilder.AddColumn<string>(
name: "CitizenId",
table: "CommandDeployments",
type: "varchar(13)",
maxLength: 13,
nullable: false,
defaultValue: "",
comment: "เลขประจำตัวประชาชน")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "FirstName",
table: "CommandDeployments",
type: "varchar(100)",
maxLength: 100,
nullable: false,
defaultValue: "",
comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "LastName",
table: "CommandDeployments",
type: "varchar(100)",
maxLength: 100,
nullable: false,
defaultValue: "",
comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "OrganizationName",
table: "CommandDeployments",
type: "longtext",
nullable: false,
comment: "ชื่อหน่วยงานของผู้รับสำเนาคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Prefix",
table: "CommandDeployments",
type: "varchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "",
comment: "คำนำหน้านาม")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "Sequence",
table: "CommandDeployments",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ลำดับ");
migrationBuilder.CreateIndex(
name: "IX_Commands_PlacementId",
table: "Commands",
column: "PlacementId");
migrationBuilder.AddForeignKey(
name: "FK_Commands_Placements_PlacementId",
table: "Commands",
column: "PlacementId",
principalTable: "Placements",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Commands_Placements_PlacementId",
table: "Commands");
migrationBuilder.DropIndex(
name: "IX_Commands_PlacementId",
table: "Commands");
migrationBuilder.DropColumn(
name: "CitizenId",
table: "CommandDeployments");
migrationBuilder.DropColumn(
name: "FirstName",
table: "CommandDeployments");
migrationBuilder.DropColumn(
name: "LastName",
table: "CommandDeployments");
migrationBuilder.DropColumn(
name: "OrganizationName",
table: "CommandDeployments");
migrationBuilder.DropColumn(
name: "Prefix",
table: "CommandDeployments");
migrationBuilder.DropColumn(
name: "Sequence",
table: "CommandDeployments");
migrationBuilder.RenameColumn(
name: "PlacementId",
table: "Commands",
newName: "ExamRoundId");
}
}
}

View file

@ -1,30 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddPositionNametoCommandDeploymentTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PositionName",
table: "CommandDeployments",
type: "longtext",
nullable: false,
comment: "ชื่อตำแหน่งของผู้รับสำเนาคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PositionName",
table: "CommandDeployments");
}
}
}

View file

@ -1,77 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addTableretire_history : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "TypeReport",
table: "RetirementPeriods",
type: "longtext",
nullable: true,
comment: "ประเภทคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RetirementPeriodHistorys",
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"),
Round = table.Column<int>(type: "int", nullable: false, comment: "ครั้งที่"),
TypeReport = table.Column<string>(type: "longtext", nullable: true, comment: "ประเภทคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4"),
Year = table.Column<int>(type: "int", nullable: false, comment: "ปีงบประมาณ"),
Total = table.Column<int>(type: "int", nullable: false, comment: "จำนวนคน"),
Type = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภท")
.Annotation("MySql:CharSet", "utf8mb4"),
ProfileFile = table.Column<string>(type: "longtext", nullable: false, comment: "รายชื่อเกษียญ")
.Annotation("MySql:CharSet", "utf8mb4"),
RetirementPeriodId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementPeriodHistorys", x => x.Id);
table.ForeignKey(
name: "FK_RetirementPeriodHistorys_RetirementPeriods_RetirementPeriodId",
column: x => x.RetirementPeriodId,
principalTable: "RetirementPeriods",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_RetirementPeriodHistorys_RetirementPeriodId",
table: "RetirementPeriodHistorys",
column: "RetirementPeriodId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RetirementPeriodHistorys");
migrationBuilder.DropColumn(
name: "TypeReport",
table: "RetirementPeriods");
}
}
}

View file

@ -1,50 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updateinsigniaadddoc : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "ReliefDocId",
table: "InsigniaPeriods",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_InsigniaPeriods_ReliefDocId",
table: "InsigniaPeriods",
column: "ReliefDocId");
migrationBuilder.AddForeignKey(
name: "FK_InsigniaPeriods_Documents_ReliefDocId",
table: "InsigniaPeriods",
column: "ReliefDocId",
principalTable: "Documents",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_InsigniaPeriods_Documents_ReliefDocId",
table: "InsigniaPeriods");
migrationBuilder.DropIndex(
name: "IX_InsigniaPeriods_ReliefDocId",
table: "InsigniaPeriods");
migrationBuilder.DropColumn(
name: "ReliefDocId",
table: "InsigniaPeriods");
}
}
}

View file

@ -1,269 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableplacementtransfer : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PlacementReceives",
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"),
CitizenId = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false, comment: "เลขประจำตัวประชาชน")
.Annotation("MySql:CharSet", "utf8mb4"),
PrefixId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Firstname = table.Column<string>(type: "longtext", nullable: false, comment: "ชื่อ")
.Annotation("MySql:CharSet", "utf8mb4"),
Lastname = table.Column<string>(type: "longtext", nullable: false, comment: "นามสกุล")
.Annotation("MySql:CharSet", "utf8mb4"),
DateOfBirth = table.Column<DateTime>(type: "datetime(6)", maxLength: 40, nullable: false, comment: "วันเกิด"),
GenderId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Nationality = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "สัญชาติ")
.Annotation("MySql:CharSet", "utf8mb4"),
Race = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "เชื้อชาติ")
.Annotation("MySql:CharSet", "utf8mb4"),
ReligionId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
BloodGroupId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
RelationshipId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TelephoneNumber = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "เบอร์โทร")
.Annotation("MySql:CharSet", "utf8mb4"),
Status = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะคำขอ")
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(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_Genders_GenderId",
column: x => x.GenderId,
principalTable: "Genders",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Organizations_OrganizationId",
column: x => x.OrganizationId,
principalTable: "Organizations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PlacementReceives_Prefixes_PrefixId",
column: x => x.PrefixId,
principalTable: "Prefixes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
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");
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PlacementTransfers",
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"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "หน่วยงานที่ขอโอนไป")
.Annotation("MySql:CharSet", "utf8mb4"),
Reason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผล")
.Annotation("MySql:CharSet", "utf8mb4"),
Status = 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_PlacementTransfers", x => x.Id);
table.ForeignKey(
name: "FK_PlacementTransfers_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PlacementReceiveDocs",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PlacementReceiveId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementReceiveDocs", x => x.Id);
table.ForeignKey(
name: "FK_PlacementReceiveDocs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PlacementReceiveDocs_PlacementReceives_PlacementReceiveId",
column: x => x.PlacementReceiveId,
principalTable: "PlacementReceives",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "PlacementTransferDocs",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
PlacementTransferId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_PlacementTransferDocs", x => x.Id);
table.ForeignKey(
name: "FK_PlacementTransferDocs_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PlacementTransferDocs_PlacementTransfers_PlacementTransferId",
column: x => x.PlacementTransferId,
principalTable: "PlacementTransfers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceiveDocs_DocumentId",
table: "PlacementReceiveDocs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceiveDocs_PlacementReceiveId",
table: "PlacementReceiveDocs",
column: "PlacementReceiveId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_BloodGroupId",
table: "PlacementReceives",
column: "BloodGroupId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_GenderId",
table: "PlacementReceives",
column: "GenderId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_OrganizationId",
table: "PlacementReceives",
column: "OrganizationId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PrefixId",
table: "PlacementReceives",
column: "PrefixId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_RelationshipId",
table: "PlacementReceives",
column: "RelationshipId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_ReligionId",
table: "PlacementReceives",
column: "ReligionId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransferDocs_DocumentId",
table: "PlacementTransferDocs",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransferDocs_PlacementTransferId",
table: "PlacementTransferDocs",
column: "PlacementTransferId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransfers_ProfileId",
table: "PlacementTransfers",
column: "ProfileId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PlacementReceiveDocs");
migrationBuilder.DropTable(
name: "PlacementTransferDocs");
migrationBuilder.DropTable(
name: "PlacementReceives");
migrationBuilder.DropTable(
name: "PlacementTransfers");
}
}
}

View file

@ -1,258 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableplacementtransfer1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_Organizations_OrganizationId",
table: "PlacementReceives");
migrationBuilder.RenameColumn(
name: "OrganizationId",
table: "PlacementReceives",
newName: "PositionTypeId");
migrationBuilder.RenameIndex(
name: "IX_PlacementReceives_OrganizationId",
table: "PlacementReceives",
newName: "IX_PlacementReceives_PositionTypeId");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationPositionId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionLevelId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionLineId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionNumberId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionPathId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionPathSideId",
table: "PlacementReceives",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<DateTime>(
name: "RecruitDate",
table: "PlacementReceives",
type: "datetime(6)",
nullable: true,
comment: "วันที่บรรจุ");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_OrganizationPositionId",
table: "PlacementReceives",
column: "OrganizationPositionId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionLevelId",
table: "PlacementReceives",
column: "PositionLevelId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionLineId",
table: "PlacementReceives",
column: "PositionLineId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionNumberId",
table: "PlacementReceives",
column: "PositionNumberId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionPathId",
table: "PlacementReceives",
column: "PositionPathId");
migrationBuilder.CreateIndex(
name: "IX_PlacementReceives_PositionPathSideId",
table: "PlacementReceives",
column: "PositionPathSideId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_OrganizationPositions_OrganizationPosition~",
table: "PlacementReceives",
column: "OrganizationPositionId",
principalTable: "OrganizationPositions",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionLevels_PositionLevelId",
table: "PlacementReceives",
column: "PositionLevelId",
principalTable: "PositionLevels",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionLines_PositionLineId",
table: "PlacementReceives",
column: "PositionLineId",
principalTable: "PositionLines",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionNumbers_PositionNumberId",
table: "PlacementReceives",
column: "PositionNumberId",
principalTable: "PositionNumbers",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionPathSides_PositionPathSideId",
table: "PlacementReceives",
column: "PositionPathSideId",
principalTable: "PositionPathSides",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionPaths_PositionPathId",
table: "PlacementReceives",
column: "PositionPathId",
principalTable: "PositionPaths",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_PositionTypes_PositionTypeId",
table: "PlacementReceives",
column: "PositionTypeId",
principalTable: "PositionTypes",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_OrganizationPositions_OrganizationPosition~",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionLevels_PositionLevelId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionLines_PositionLineId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionNumbers_PositionNumberId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionPathSides_PositionPathSideId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionPaths_PositionPathId",
table: "PlacementReceives");
migrationBuilder.DropForeignKey(
name: "FK_PlacementReceives_PositionTypes_PositionTypeId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_OrganizationPositionId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionLevelId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionLineId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionNumberId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionPathId",
table: "PlacementReceives");
migrationBuilder.DropIndex(
name: "IX_PlacementReceives_PositionPathSideId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "OrganizationPositionId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionLevelId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionLineId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionNumberId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionPathId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "PositionPathSideId",
table: "PlacementReceives");
migrationBuilder.DropColumn(
name: "RecruitDate",
table: "PlacementReceives");
migrationBuilder.RenameColumn(
name: "PositionTypeId",
table: "PlacementReceives",
newName: "OrganizationId");
migrationBuilder.RenameIndex(
name: "IX_PlacementReceives_PositionTypeId",
table: "PlacementReceives",
newName: "IX_PlacementReceives_OrganizationId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementReceives_Organizations_OrganizationId",
table: "PlacementReceives",
column: "OrganizationId",
principalTable: "Organizations",
principalColumn: "Id");
}
}
}

View file

@ -1,81 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableorgaddorgagency : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "OrganizationAgencyId",
table: "Organizations",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationGovernmentAgencyId",
table: "Organizations",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_Organizations_OrganizationAgencyId",
table: "Organizations",
column: "OrganizationAgencyId");
migrationBuilder.CreateIndex(
name: "IX_Organizations_OrganizationGovernmentAgencyId",
table: "Organizations",
column: "OrganizationGovernmentAgencyId");
migrationBuilder.AddForeignKey(
name: "FK_Organizations_OrganizationAgencys_OrganizationAgencyId",
table: "Organizations",
column: "OrganizationAgencyId",
principalTable: "OrganizationAgencys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Organizations_OrganizationGovernmentAgencys_OrganizationGove~",
table: "Organizations",
column: "OrganizationGovernmentAgencyId",
principalTable: "OrganizationGovernmentAgencys",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Organizations_OrganizationAgencys_OrganizationAgencyId",
table: "Organizations");
migrationBuilder.DropForeignKey(
name: "FK_Organizations_OrganizationGovernmentAgencys_OrganizationGove~",
table: "Organizations");
migrationBuilder.DropIndex(
name: "IX_Organizations_OrganizationAgencyId",
table: "Organizations");
migrationBuilder.DropIndex(
name: "IX_Organizations_OrganizationGovernmentAgencyId",
table: "Organizations");
migrationBuilder.DropColumn(
name: "OrganizationAgencyId",
table: "Organizations");
migrationBuilder.DropColumn(
name: "OrganizationGovernmentAgencyId",
table: "Organizations");
}
}
}

View file

@ -1,107 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableorgaddorgagency1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Organizations_OrganizationAgencys_OrganizationAgencyId",
table: "Organizations");
migrationBuilder.DropForeignKey(
name: "FK_Organizations_OrganizationGovernmentAgencys_OrganizationGove~",
table: "Organizations");
migrationBuilder.DropIndex(
name: "IX_Organizations_OrganizationAgencyId",
table: "Organizations");
migrationBuilder.DropIndex(
name: "IX_Organizations_OrganizationGovernmentAgencyId",
table: "Organizations");
migrationBuilder.DropColumn(
name: "OrganizationAgencyId",
table: "Organizations");
migrationBuilder.DropColumn(
name: "OrganizationGovernmentAgencyId",
table: "Organizations");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationAgency",
table: "Organizations",
type: "char(36)",
nullable: true,
comment: "OrganizationAgencyId",
collation: "ascii_general_ci")
.Annotation("Relational:ColumnOrder", 10);
migrationBuilder.AddColumn<Guid>(
name: "OrganizationGovernmentAgency",
table: "Organizations",
type: "char(36)",
nullable: true,
comment: "OrganizationGovernmentAgencyId",
collation: "ascii_general_ci")
.Annotation("Relational:ColumnOrder", 11);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OrganizationAgency",
table: "Organizations");
migrationBuilder.DropColumn(
name: "OrganizationGovernmentAgency",
table: "Organizations");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationAgencyId",
table: "Organizations",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationGovernmentAgencyId",
table: "Organizations",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_Organizations_OrganizationAgencyId",
table: "Organizations",
column: "OrganizationAgencyId");
migrationBuilder.CreateIndex(
name: "IX_Organizations_OrganizationGovernmentAgencyId",
table: "Organizations",
column: "OrganizationGovernmentAgencyId");
migrationBuilder.AddForeignKey(
name: "FK_Organizations_OrganizationAgencys_OrganizationAgencyId",
table: "Organizations",
column: "OrganizationAgencyId",
principalTable: "OrganizationAgencys",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Organizations_OrganizationGovernmentAgencys_OrganizationGove~",
table: "Organizations",
column: "OrganizationGovernmentAgencyId",
principalTable: "OrganizationGovernmentAgencys",
principalColumn: "Id");
}
}
}

View file

@ -1,38 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableorgaddorgagency2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "OrganizationGovernmentAgency",
table: "Organizations",
newName: "OrganizationGovernmentAgencyId");
migrationBuilder.RenameColumn(
name: "OrganizationAgency",
table: "Organizations",
newName: "OrganizationAgencyId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "OrganizationGovernmentAgencyId",
table: "Organizations",
newName: "OrganizationGovernmentAgency");
migrationBuilder.RenameColumn(
name: "OrganizationAgencyId",
table: "Organizations",
newName: "OrganizationAgency");
}
}
}

View file

@ -1,42 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddfieldtoProfileSalaryTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CommandNo",
table: "ProfileSalaries",
type: "longtext",
nullable: false,
comment: "เลขที่คำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "CommandTypeName",
table: "ProfileSalaries",
type: "longtext",
nullable: false,
comment: "ประเภทคำสั่ง")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CommandNo",
table: "ProfileSalaries");
migrationBuilder.DropColumn(
name: "CommandTypeName",
table: "ProfileSalaries");
}
}
}

View file

@ -1,188 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class addtableRetirementDeceased : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "InsigniaPeriods",
type: "tinyint(1)",
nullable: false,
defaultValue: false,
comment: "สถานะการใช้งาน");
migrationBuilder.CreateTable(
name: "RetirementDeceaseds",
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"),
DocumentId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Number = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ใบมรณบัตร")
.Annotation("MySql:CharSet", "utf8mb4"),
Date = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เสียชีวิต"),
Location = table.Column<string>(type: "longtext", nullable: true, comment: "สถานที่ออกใบมรณบัตร")
.Annotation("MySql:CharSet", "utf8mb4"),
Reason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลการเสียชีวิต")
.Annotation("MySql:CharSet", "utf8mb4"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementDeceaseds", x => x.Id);
table.ForeignKey(
name: "FK_RetirementDeceaseds_Documents_DocumentId",
column: x => x.DocumentId,
principalTable: "Documents",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RetirementDeceaseds_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RetirementResigns",
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"),
Location = table.Column<string>(type: "longtext", nullable: true, comment: "สถานที่ยื่นขอลาออกราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
SendDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ยื่นขอออกราชการ"),
ActiveDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่ขอออกราชการ"),
Reason = table.Column<string>(type: "longtext", nullable: true, comment: "เหตุผลที่ลาออกจากราชการ")
.Annotation("MySql:CharSet", "utf8mb4"),
ProfileId = table.Column<Guid>(type: "char(36)", nullable: false, 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"),
PositionExecutiveId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
OrganizationOrganizationId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Status = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะลาออก")
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "สถานะการใช้งาน")
},
constraints: table =>
{
table.PrimaryKey("PK_RetirementResigns", x => x.Id);
table.ForeignKey(
name: "FK_RetirementResigns_OrganizationOrganizations_OrganizationOrga~",
column: x => x.OrganizationOrganizationId,
principalTable: "OrganizationOrganizations",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RetirementResigns_PositionExecutives_PositionExecutiveId",
column: x => x.PositionExecutiveId,
principalTable: "PositionExecutives",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RetirementResigns_PositionLevels_PositionLevelId",
column: x => x.PositionLevelId,
principalTable: "PositionLevels",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RetirementResigns_PositionLines_PositionLineId",
column: x => x.PositionLineId,
principalTable: "PositionLines",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RetirementResigns_PositionTypes_PositionTypeId",
column: x => x.PositionTypeId,
principalTable: "PositionTypes",
principalColumn: "Id");
table.ForeignKey(
name: "FK_RetirementResigns_Profiles_ProfileId",
column: x => x.ProfileId,
principalTable: "Profiles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_RetirementDeceaseds_DocumentId",
table: "RetirementDeceaseds",
column: "DocumentId");
migrationBuilder.CreateIndex(
name: "IX_RetirementDeceaseds_ProfileId",
table: "RetirementDeceaseds",
column: "ProfileId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResigns_OrganizationOrganizationId",
table: "RetirementResigns",
column: "OrganizationOrganizationId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResigns_PositionExecutiveId",
table: "RetirementResigns",
column: "PositionExecutiveId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResigns_PositionLevelId",
table: "RetirementResigns",
column: "PositionLevelId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResigns_PositionLineId",
table: "RetirementResigns",
column: "PositionLineId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResigns_PositionTypeId",
table: "RetirementResigns",
column: "PositionTypeId");
migrationBuilder.CreateIndex(
name: "IX_RetirementResigns_ProfileId",
table: "RetirementResigns",
column: "ProfileId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RetirementDeceaseds");
migrationBuilder.DropTable(
name: "RetirementResigns");
migrationBuilder.DropColumn(
name: "IsActive",
table: "InsigniaPeriods");
}
}
}

View file

@ -1,89 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class AddInboxandNotificationTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Inboxes",
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"),
Subject = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "หัวเรื่อง")
.Annotation("MySql:CharSet", "utf8mb4"),
Body = table.Column<string>(type: "text", nullable: false, comment: "รายละเอียดข้อความ")
.Annotation("MySql:CharSet", "utf8mb4"),
ReceiverUserId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสผู้รับข้อความ", collation: "ascii_general_ci"),
Payload = table.Column<string>(type: "text", nullable: false, comment: "สิงที่แนบมาด้วย")
.Annotation("MySql:CharSet", "utf8mb4"),
IsOpen = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "เปิดอ่านแล้วหรือยัง"),
ReceiveDate = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันที่ได้รับ"),
OpenDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เปิดอ่าน")
},
constraints: table =>
{
table.PrimaryKey("PK_Inboxes", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Notifications",
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"),
Body = table.Column<string>(type: "text", nullable: false, comment: "รายละเอียดข้อความ")
.Annotation("MySql:CharSet", "utf8mb4"),
ReceiverUserId = table.Column<Guid>(type: "char(36)", nullable: false, comment: "รหัสผู้รับข้อความ", collation: "ascii_general_ci"),
Type = table.Column<string>(type: "longtext", nullable: false, comment: "ประเภทการแจ้งเตือน")
.Annotation("MySql:CharSet", "utf8mb4"),
Payload = table.Column<string>(type: "text", nullable: false, comment: "สิงที่แนบมาด้วย")
.Annotation("MySql:CharSet", "utf8mb4"),
IsOpen = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "เปิดอ่านแล้วหรือยัง"),
ReceiveDate = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันที่ได้รับ"),
OpenDate = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เปิดอ่าน")
},
constraints: table =>
{
table.PrimaryKey("PK_Notifications", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Inboxes");
migrationBuilder.DropTable(
name: "Notifications");
}
}
}

View file

@ -1,188 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableInsigniaRequestProfilefeildDocumentStatusnull : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Special",
table: "InsigniaRequestProfiles",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<double>(
name: "Salary",
table: "InsigniaRequestProfiles",
type: "double",
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(65,30)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "QualificationStatus",
table: "InsigniaRequestProfiles",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Note",
table: "InsigniaRequestProfiles",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "MatchingConditions",
table: "InsigniaRequestProfiles",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "DocumentStatus",
table: "InsigniaRequestProfiles",
type: "varchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "InsigniaRequestProfiles",
keyColumn: "Special",
keyValue: null,
column: "Special",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Special",
table: "InsigniaRequestProfiles",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<decimal>(
name: "Salary",
table: "InsigniaRequestProfiles",
type: "decimal(65,30)",
nullable: true,
oldClrType: typeof(double),
oldType: "double",
oldNullable: true);
migrationBuilder.UpdateData(
table: "InsigniaRequestProfiles",
keyColumn: "QualificationStatus",
keyValue: null,
column: "QualificationStatus",
value: "");
migrationBuilder.AlterColumn<string>(
name: "QualificationStatus",
table: "InsigniaRequestProfiles",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "InsigniaRequestProfiles",
keyColumn: "Note",
keyValue: null,
column: "Note",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Note",
table: "InsigniaRequestProfiles",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "InsigniaRequestProfiles",
keyColumn: "MatchingConditions",
keyValue: null,
column: "MatchingConditions",
value: "");
migrationBuilder.AlterColumn<string>(
name: "MatchingConditions",
table: "InsigniaRequestProfiles",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "InsigniaRequestProfiles",
keyColumn: "DocumentStatus",
keyValue: null,
column: "DocumentStatus",
value: "");
migrationBuilder.AlterColumn<string>(
name: "DocumentStatus",
table: "InsigniaRequestProfiles",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -1,165 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetablePlacementTransfersaddposition : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<double>(
name: "AmountOld",
table: "PlacementTransfers",
type: "double",
nullable: true,
comment: "ข้อมูลหน่วยงานเดิม เงินเดือน");
migrationBuilder.AddColumn<DateTime>(
name: "Date",
table: "PlacementTransfers",
type: "datetime(6)",
nullable: true,
comment: "ตั้งแต่วันที่");
migrationBuilder.AddColumn<Guid>(
name: "OrganizationPositionOldId",
table: "PlacementTransfers",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionLevelOldId",
table: "PlacementTransfers",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionNumberOldId",
table: "PlacementTransfers",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddColumn<Guid>(
name: "PositionTypeOldId",
table: "PlacementTransfers",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransfers_OrganizationPositionOldId",
table: "PlacementTransfers",
column: "OrganizationPositionOldId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransfers_PositionLevelOldId",
table: "PlacementTransfers",
column: "PositionLevelOldId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransfers_PositionNumberOldId",
table: "PlacementTransfers",
column: "PositionNumberOldId");
migrationBuilder.CreateIndex(
name: "IX_PlacementTransfers_PositionTypeOldId",
table: "PlacementTransfers",
column: "PositionTypeOldId");
migrationBuilder.AddForeignKey(
name: "FK_PlacementTransfers_OrganizationPositions_OrganizationPositio~",
table: "PlacementTransfers",
column: "OrganizationPositionOldId",
principalTable: "OrganizationPositions",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementTransfers_PositionLevels_PositionLevelOldId",
table: "PlacementTransfers",
column: "PositionLevelOldId",
principalTable: "PositionLevels",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementTransfers_PositionNumbers_PositionNumberOldId",
table: "PlacementTransfers",
column: "PositionNumberOldId",
principalTable: "PositionNumbers",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PlacementTransfers_PositionTypes_PositionTypeOldId",
table: "PlacementTransfers",
column: "PositionTypeOldId",
principalTable: "PositionTypes",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PlacementTransfers_OrganizationPositions_OrganizationPositio~",
table: "PlacementTransfers");
migrationBuilder.DropForeignKey(
name: "FK_PlacementTransfers_PositionLevels_PositionLevelOldId",
table: "PlacementTransfers");
migrationBuilder.DropForeignKey(
name: "FK_PlacementTransfers_PositionNumbers_PositionNumberOldId",
table: "PlacementTransfers");
migrationBuilder.DropForeignKey(
name: "FK_PlacementTransfers_PositionTypes_PositionTypeOldId",
table: "PlacementTransfers");
migrationBuilder.DropIndex(
name: "IX_PlacementTransfers_OrganizationPositionOldId",
table: "PlacementTransfers");
migrationBuilder.DropIndex(
name: "IX_PlacementTransfers_PositionLevelOldId",
table: "PlacementTransfers");
migrationBuilder.DropIndex(
name: "IX_PlacementTransfers_PositionNumberOldId",
table: "PlacementTransfers");
migrationBuilder.DropIndex(
name: "IX_PlacementTransfers_PositionTypeOldId",
table: "PlacementTransfers");
migrationBuilder.DropColumn(
name: "AmountOld",
table: "PlacementTransfers");
migrationBuilder.DropColumn(
name: "Date",
table: "PlacementTransfers");
migrationBuilder.DropColumn(
name: "OrganizationPositionOldId",
table: "PlacementTransfers");
migrationBuilder.DropColumn(
name: "PositionLevelOldId",
table: "PlacementTransfers");
migrationBuilder.DropColumn(
name: "PositionNumberOldId",
table: "PlacementTransfers");
migrationBuilder.DropColumn(
name: "PositionTypeOldId",
table: "PlacementTransfers");
}
}
}

Some files were not shown because too many files have changed in this diff Show more