using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BMA.EHR.Infrastructure.Migrations { /// public partial class updateTablepositionpathaddorder : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( 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( 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( name: "Order", table: "PositionTypes", type: "int", nullable: true, comment: "ลำดับ") .Annotation("Relational:ColumnOrder", 1); migrationBuilder.AlterColumn( 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( 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( 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( 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( name: "Order", table: "PositionLevels", type: "int", nullable: true, comment: "ลำดับ") .Annotation("Relational:ColumnOrder", 1); migrationBuilder.AlterColumn( 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( 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( name: "Order", table: "PositionEmployeeLevels", type: "int", nullable: true, comment: "ลำดับ") .Annotation("Relational:ColumnOrder", 1); } /// 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( 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( 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( 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( 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( 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( 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( 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( 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); } } }