using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace TaskManager.EntityFramework.Migrations { /// public partial class z202506240001 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "CreationTime", table: "TaskLogs", type: "datetime2", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), oldClrType: typeof(DateTime), oldType: "datetime2", oldNullable: true); migrationBuilder.AlterColumn( name: "DeadLine", table: "SUPPLIER_PRO_MATERIAL_STOCK", type: "VARCHAR(30)", maxLength: 30, nullable: false, oldClrType: typeof(string), oldType: "VARCHAR(10)", oldMaxLength: 10); migrationBuilder.CreateTable( name: "DynamicTableRecords", columns: table => new { UId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), TableId = table.Column(type: "bigint", nullable: false), RecordJson = table.Column(type: "nvarchar(max)", nullable: false), WriteState = table.Column(type: "bit", nullable: false), ReadState = table.Column(type: "bit", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), Remark = table.Column(type: "nvarchar(max)", nullable: true), TaskId = table.Column(type: "uniqueidentifier", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DynamicTableRecords", x => x.UId); }); migrationBuilder.CreateTable( name: "DynamicTables", columns: table => new { UId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), TableName = table.Column(type: "nvarchar(max)", nullable: false), SchemaJson = table.Column(type: "nvarchar(max)", nullable: false), WriteState = table.Column(type: "bit", nullable: false), ReadState = table.Column(type: "bit", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), Remark = table.Column(type: "nvarchar(max)", nullable: true), TaskId = table.Column(type: "uniqueidentifier", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DynamicTables", x => x.UId); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DynamicTableRecords"); migrationBuilder.DropTable( name: "DynamicTables"); migrationBuilder.AlterColumn( name: "CreationTime", table: "TaskLogs", type: "datetime2", nullable: true, oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AlterColumn( name: "DeadLine", table: "SUPPLIER_PRO_MATERIAL_STOCK", type: "VARCHAR(10)", maxLength: 10, nullable: false, oldClrType: typeof(string), oldType: "VARCHAR(30)", oldMaxLength: 30); } } }