45 lines
1.7 KiB
C#
45 lines
1.7 KiB
C#
|
|
using System;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|
|||
|
|
#nullable disable
|
|||
|
|
|
|||
|
|
namespace JiShe.CollectBus.EntityFrameworkCore.Migrations
|
|||
|
|
{
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
public partial class Init : Migration
|
|||
|
|
{
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.AlterDatabase()
|
|||
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateTable(
|
|||
|
|
name: "Devices",
|
|||
|
|
columns: table => new
|
|||
|
|
{
|
|||
|
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|||
|
|
DeviceNo = table.Column<string>(type: "longtext", nullable: false)
|
|||
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|||
|
|
DeviceStatus = table.Column<int>(type: "int", nullable: false),
|
|||
|
|
CreatorId = table.Column<long>(type: "bigint", nullable: true),
|
|||
|
|
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|||
|
|
LastModifierId = table.Column<long>(type: "bigint", nullable: true),
|
|||
|
|
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|||
|
|
},
|
|||
|
|
constraints: table =>
|
|||
|
|
{
|
|||
|
|
table.PrimaryKey("PK_Devices", x => x.Id);
|
|||
|
|
})
|
|||
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.DropTable(
|
|||
|
|
name: "Devices");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|