migrate db insignia add round

This commit is contained in:
Kittapath 2023-08-18 12:13:16 +07:00
parent f386a5fea6
commit d30030141a
3 changed files with 15024 additions and 3 deletions

View file

@ -0,0 +1,194 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableperiodinsignaupdateround : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// migrationBuilder.AddColumn<bool>(
// name: "IsActive",
// table: "ProfileSalaries",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false);
// migrationBuilder.AddColumn<string>(
// name: "CoupleCitizenId",
// table: "Profiles",
// type: "varchar(20)",
// maxLength: 20,
// nullable: true,
// comment: "เลขที่บัตรประชาชนคู่สมรส")
// .Annotation("MySql:CharSet", "utf8mb4");
// migrationBuilder.AddColumn<bool>(
// name: "CoupleLive",
// table: "Profiles",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false,
// comment: "มีชีวิตคู่สมรส");
// migrationBuilder.AddColumn<string>(
// name: "FatherCitizenId",
// table: "Profiles",
// type: "varchar(20)",
// maxLength: 20,
// nullable: true,
// comment: "เลขที่บัตรประชาชนบิดา")
// .Annotation("MySql:CharSet", "utf8mb4");
// migrationBuilder.AddColumn<bool>(
// name: "FatherLive",
// table: "Profiles",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false,
// comment: "มีชีวิตบิดา");
// migrationBuilder.AddColumn<string>(
// name: "MotherCitizenId",
// table: "Profiles",
// type: "varchar(20)",
// maxLength: 20,
// nullable: true,
// comment: "เลขที่บัตรประชาชนมารดา")
// .Annotation("MySql:CharSet", "utf8mb4");
// migrationBuilder.AddColumn<bool>(
// name: "MotherLive",
// table: "Profiles",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false,
// comment: "มีชีวิตมารดา");
// migrationBuilder.AddColumn<bool>(
// name: "IsActive",
// table: "ProfilePositions",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false);
// migrationBuilder.AddColumn<bool>(
// name: "IsPublished",
// table: "ProfilePositions",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false);
// migrationBuilder.AddColumn<bool>(
// name: "IsActive",
// table: "ProfileEducations",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false);
// migrationBuilder.AddColumn<bool>(
// name: "IsActive",
// table: "ProfileCertificates",
// type: "tinyint(1)",
// nullable: false,
// defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Status",
table: "InsigniaRequestProfiles",
type: "longtext",
nullable: false,
comment: "สถานะตำแหน่งที่ยื่นขอ")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<int>(
name: "Amount",
table: "InsigniaPeriods",
type: "int",
maxLength: 50,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "Round",
table: "InsigniaPeriods",
type: "int",
nullable: false,
defaultValue: 0,
comment: "ราบการยื่นขอ");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
// migrationBuilder.DropColumn(
// name: "IsActive",
// table: "ProfileSalaries");
// migrationBuilder.DropColumn(
// name: "CoupleCitizenId",
// table: "Profiles");
// migrationBuilder.DropColumn(
// name: "CoupleLive",
// table: "Profiles");
// migrationBuilder.DropColumn(
// name: "FatherCitizenId",
// table: "Profiles");
// migrationBuilder.DropColumn(
// name: "FatherLive",
// table: "Profiles");
// migrationBuilder.DropColumn(
// name: "MotherCitizenId",
// table: "Profiles");
// migrationBuilder.DropColumn(
// name: "MotherLive",
// table: "Profiles");
// migrationBuilder.DropColumn(
// name: "IsActive",
// table: "ProfilePositions");
// migrationBuilder.DropColumn(
// name: "IsPublished",
// table: "ProfilePositions");
// migrationBuilder.DropColumn(
// name: "IsActive",
// table: "ProfileEducations");
// migrationBuilder.DropColumn(
// name: "IsActive",
// table: "ProfileCertificates");
migrationBuilder.DropColumn(
name: "Status",
table: "InsigniaRequestProfiles");
migrationBuilder.DropColumn(
name: "Round",
table: "InsigniaPeriods");
migrationBuilder.AlterColumn<string>(
name: "Amount",
table: "InsigniaPeriods",
type: "varchar(50)",
maxLength: 50,
nullable: false,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50)
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}

View file

@ -5140,10 +5140,9 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasComment("PrimaryKey")
.HasAnnotation("Relational:JsonPropertyName", "id");
b.Property<string>("Amount")
.IsRequired()
b.Property<int>("Amount")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
@ -5198,6 +5197,10 @@ namespace BMA.EHR.Infrastructure.Migrations
b.Property<Guid?>("ReliefDocId")
.HasColumnType("char(36)");
b.Property<int>("Round")
.HasColumnType("int")
.HasComment("ราบการยื่นขอ");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime(6)");
@ -5370,6 +5373,11 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("longtext")
.HasComment("สถานะตำแหน่งที่ยื่นขอ");
b.HasKey("Id");
b.HasIndex("ProfileId");