hrms-api-backend/BMA.EHR.Infrastructure/Migrations/20230724064919_update Table retire add year.cs

77 lines
2.7 KiB
C#
Raw Normal View History

2023-07-25 14:32:02 +07:00
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");
}
}
}