Files
mapo-mono/MP.MONO.Data/Migrations/20220315084318_AddAlarmLog.cs

53 lines
2.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MP.MONO.Data.Migrations
{
public partial class AddAlarmLog : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AlarmLog",
columns: table => new
{
AlarmLogId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DtRif = table.Column<DateTime>(type: "datetime(6)", nullable: false),
MachineId = table.Column<int>(type: "int", nullable: false),
MemAddress = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Index = table.Column<int>(type: "int", nullable: false),
Status = table.Column<uint>(type: "int unsigned", nullable: false),
ValDecoded = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AlarmLog", x => x.AlarmLogId);
table.ForeignKey(
name: "FK_AlarmLog_Machine_MachineId",
column: x => x.MachineId,
principalTable: "Machine",
principalColumn: "MachineId",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_AlarmLog_MachineId",
table: "AlarmLog",
column: "MachineId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AlarmLog");
}
}
}