shoc-legacy/Data.SeaHavenIndustries/Migrations/20231222052903_templateupdated.cs

60 lines
1.8 KiB
C#
Raw Normal View History

2024-09-28 14:58:36 -04:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
/// <inheritdoc />
public partial class templateupdated : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "POC",
table: "Templates",
newName: "SignOffAttachment");
migrationBuilder.AddColumn<int>(
name: "ContactId",
table: "Templates",
type: "int",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Templates_ContactId",
table: "Templates",
column: "ContactId");
migrationBuilder.AddForeignKey(
name: "FK_Templates_Contacts_ContactId",
table: "Templates",
column: "ContactId",
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Templates_Contacts_ContactId",
table: "Templates");
migrationBuilder.DropIndex(
name: "IX_Templates_ContactId",
table: "Templates");
migrationBuilder.DropColumn(
name: "ContactId",
table: "Templates");
migrationBuilder.RenameColumn(
name: "SignOffAttachment",
table: "Templates",
newName: "POC");
}
}
}