hrms-api-backend/BMA.EHR.Infrastructure/Migrations/DisciplineDb/20240117023554_update table DisciplineDirectors add qualification.cs

94 lines
3.4 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
{
/// <inheritdoc />
public partial class updatetableDisciplineDirectorsaddqualification : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Phone",
table: "DisciplineDirectors",
type: "longtext",
nullable: true,
comment: "เบอร์โทรศัพท์",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "เบอร์โทรศัพท์")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "DisciplineDirectors",
type: "longtext",
nullable: true,
comment: "อีเมล",
oldClrType: typeof(string),
oldType: "longtext",
oldComment: "อีเมล")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Qualification",
table: "DisciplineDirectors",
type: "longtext",
nullable: true,
comment: "คุณวุฒิ")
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Qualification",
table: "DisciplineDirectors");
migrationBuilder.UpdateData(
table: "DisciplineDirectors",
keyColumn: "Phone",
keyValue: null,
column: "Phone",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Phone",
table: "DisciplineDirectors",
type: "longtext",
nullable: false,
comment: "เบอร์โทรศัพท์",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "เบอร์โทรศัพท์")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "DisciplineDirectors",
keyColumn: "Email",
keyValue: null,
column: "Email",
value: "");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "DisciplineDirectors",
type: "longtext",
nullable: false,
comment: "อีเมล",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "อีเมล")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}