Files
magman/MagMan.Data.Tenant/Migrations/20240427093933_AddLogMachine.cs
samuele b38d0bfea8 MagMan.Data.Tenant:
- fix LogMachine con SupervId
- fix migrations
2024-04-30 09:11:45 +02:00

53 lines
2.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MagMan.Data.Tenant.Migrations
{
public partial class AddLogMachine : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "LogMachine",
columns: table => new
{
DbId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
KeyNum = table.Column<int>(type: "int", nullable: false),
MachineID = table.Column<int>(type: "int", nullable: false),
ProjDbId = table.Column<int>(type: "int", nullable: false),
DtEvent = table.Column<DateTime>(type: "datetime(6)", nullable: false),
EvType = table.Column<int>(type: "int", nullable: false),
SupervId = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
VarValue = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_LogMachine", x => x.DbId);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_LogMachine_KeyNum",
table: "LogMachine",
column: "KeyNum");
migrationBuilder.CreateIndex(
name: "IX_LogMachine_MachineID",
table: "LogMachine",
column: "MachineID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LogMachine");
}
}
}