You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
4.1 KiB
101 lines
4.1 KiB
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace TaskManager.EntityFramework.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class z202506240001 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<DateTime>(
|
|
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<string>(
|
|
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<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
TableId = table.Column<long>(type: "bigint", nullable: false),
|
|
RecordJson = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
WriteState = table.Column<bool>(type: "bit", nullable: false),
|
|
ReadState = table.Column<bool>(type: "bit", nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
TaskId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_DynamicTableRecords", x => x.UId);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "DynamicTables",
|
|
columns: table => new
|
|
{
|
|
UId = table.Column<long>(type: "bigint", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
TableName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
SchemaJson = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
WriteState = table.Column<bool>(type: "bit", nullable: false),
|
|
ReadState = table.Column<bool>(type: "bit", nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
TaskId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_DynamicTables", x => x.UId);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "DynamicTableRecords");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "DynamicTables");
|
|
|
|
migrationBuilder.AlterColumn<DateTime>(
|
|
name: "CreationTime",
|
|
table: "TaskLogs",
|
|
type: "datetime2",
|
|
nullable: true,
|
|
oldClrType: typeof(DateTime),
|
|
oldType: "datetime2");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "DeadLine",
|
|
table: "SUPPLIER_PRO_MATERIAL_STOCK",
|
|
type: "VARCHAR(10)",
|
|
maxLength: 10,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "VARCHAR(30)",
|
|
oldMaxLength: 30);
|
|
}
|
|
}
|
|
}
|
|
|