149 lines
5.2 KiB
C#
149 lines
5.2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
namespace Cowain.TestProject.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class palletinfo : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "pallet_status");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "PalletStatus",
|
|
table: "pallet_info_history",
|
|
type: "longtext",
|
|
nullable: false,
|
|
oldClrType: typeof(int),
|
|
oldType: "int")
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "BakingCount",
|
|
table: "pallet_info_history",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "BindingId",
|
|
table: "pallet_info_history",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "PalletStatus",
|
|
table: "pallet_info",
|
|
type: "longtext",
|
|
nullable: false,
|
|
oldClrType: typeof(int),
|
|
oldType: "int")
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "BakingCount",
|
|
table: "pallet_info",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "user",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreateTime",
|
|
value: new DateTime(2026, 1, 26, 20, 25, 13, 22, DateTimeKind.Local).AddTicks(9183));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "user_role",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreateTime",
|
|
value: new DateTime(2026, 1, 26, 20, 25, 13, 34, DateTimeKind.Local).AddTicks(6570));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "BakingCount",
|
|
table: "pallet_info_history");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "BindingId",
|
|
table: "pallet_info_history");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "BakingCount",
|
|
table: "pallet_info");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "PalletStatus",
|
|
table: "pallet_info_history",
|
|
type: "int",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "longtext")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "PalletStatus",
|
|
table: "pallet_info",
|
|
type: "int",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "longtext")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "pallet_status",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Desc = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_pallet_status", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "pallet_status",
|
|
columns: new[] { "Id", "Desc", "Name" },
|
|
values: new object[,]
|
|
{
|
|
{ 1, "新托盘", "New" },
|
|
{ 2, "上料中", "Loading" }
|
|
});
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "user",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreateTime",
|
|
value: new DateTime(2026, 1, 26, 13, 31, 17, 455, DateTimeKind.Local).AddTicks(4003));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "user_role",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreateTime",
|
|
value: new DateTime(2026, 1, 26, 13, 31, 17, 460, DateTimeKind.Local).AddTicks(6222));
|
|
}
|
|
}
|
|
}
|