64 lines
2.7 KiB
C#
64 lines
2.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace MP.MONO.Data.Migrations
|
|
{
|
|
public partial class UpdateSchedTask : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "ScheduledMaintTask",
|
|
columns: table => new
|
|
{
|
|
SMTaskId = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
PMTaskId = table.Column<int>(type: "int", nullable: false),
|
|
ExpiryVal = table.Column<double>(type: "double", nullable: false),
|
|
CCode = table.Column<string>(type: "varchar(250)", nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
DtCreation = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
DtExecution = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
UserCode = table.Column<string>(type: "longtext", nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ScheduledMaintTask", x => x.SMTaskId);
|
|
table.ForeignKey(
|
|
name: "FK_ScheduledMaintTask_Counter_CCode",
|
|
column: x => x.CCode,
|
|
principalTable: "Counter",
|
|
principalColumn: "CCode",
|
|
onDelete: ReferentialAction.Restrict);
|
|
table.ForeignKey(
|
|
name: "FK_ScheduledMaintTask_PrevMaintTask_PMTaskId",
|
|
column: x => x.PMTaskId,
|
|
principalTable: "PrevMaintTask",
|
|
principalColumn: "PMTaskId",
|
|
onDelete: ReferentialAction.Restrict);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ScheduledMaintTask_CCode",
|
|
table: "ScheduledMaintTask",
|
|
column: "CCode");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ScheduledMaintTask_PMTaskId",
|
|
table: "ScheduledMaintTask",
|
|
column: "PMTaskId");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "ScheduledMaintTask");
|
|
}
|
|
}
|
|
}
|