56 lines
2.2 KiB
C#
56 lines
2.2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace wtmProject.DataAccess.Migrations
|
|
{
|
|
public partial class hmr2025032501 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "WTM_VISIT_PLAN_FILE",
|
|
columns: table => new
|
|
{
|
|
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
VisitPlanId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
FileId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
Order = table.Column<int>(type: "int", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_WTM_VISIT_PLAN_FILE", x => x.ID);
|
|
table.ForeignKey(
|
|
name: "FK_WTM_VISIT_PLAN_FILE_FileAttachments_FileId",
|
|
column: x => x.FileId,
|
|
principalTable: "FileAttachments",
|
|
principalColumn: "ID",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_WTM_VISIT_PLAN_FILE_WTM_VISIT_PLAN_VisitPlanId",
|
|
column: x => x.VisitPlanId,
|
|
principalTable: "WTM_VISIT_PLAN",
|
|
principalColumn: "ID",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_WTM_VISIT_PLAN_FILE_FileId",
|
|
table: "WTM_VISIT_PLAN_FILE",
|
|
column: "FileId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_WTM_VISIT_PLAN_FILE_VisitPlanId",
|
|
table: "WTM_VISIT_PLAN_FILE",
|
|
column: "VisitPlanId");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "WTM_VISIT_PLAN_FILE");
|
|
}
|
|
}
|
|
}
|