shoc-backend/Data.SeaHavenIndustries/Migrations/20231219110203_changesinaddwork2.cs
2024-09-28 14:58:36 -04:00

59 lines
1.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
/// <inheritdoc />
public partial class changesinaddwork2 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "POC",
table: "workOrders",
newName: "SignOffAttachment");
migrationBuilder.AddColumn<int>(
name: "ContactId",
table: "workOrders",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_workOrders_ContactId",
table: "workOrders",
column: "ContactId");
migrationBuilder.AddForeignKey(
name: "FK_workOrders_Contacts_ContactId",
table: "workOrders",
column: "ContactId",
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_workOrders_Contacts_ContactId",
table: "workOrders");
migrationBuilder.DropIndex(
name: "IX_workOrders_ContactId",
table: "workOrders");
migrationBuilder.DropColumn(
name: "ContactId",
table: "workOrders");
migrationBuilder.RenameColumn(
name: "SignOffAttachment",
table: "workOrders",
newName: "POC");
}
}
}