using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
///
public partial class AddLocationFields : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "AccountId",
table: "Locations",
type: "int",
nullable: true);
migrationBuilder.AddColumn(
name: "Address",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "City",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "Contact",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "ContactEmail",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "Phone",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "State",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "Status",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn(
name: "ZipCode",
table: "Locations",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Locations_AccountId",
table: "Locations",
column: "AccountId");
migrationBuilder.AddForeignKey(
name: "FK_Locations_Accounts_AccountId",
table: "Locations",
column: "AccountId",
principalTable: "Accounts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Locations_Accounts_AccountId",
table: "Locations");
migrationBuilder.DropIndex(
name: "IX_Locations_AccountId",
table: "Locations");
migrationBuilder.DropColumn(
name: "AccountId",
table: "Locations");
migrationBuilder.DropColumn(
name: "Address",
table: "Locations");
migrationBuilder.DropColumn(
name: "City",
table: "Locations");
migrationBuilder.DropColumn(
name: "Contact",
table: "Locations");
migrationBuilder.DropColumn(
name: "ContactEmail",
table: "Locations");
migrationBuilder.DropColumn(
name: "Phone",
table: "Locations");
migrationBuilder.DropColumn(
name: "State",
table: "Locations");
migrationBuilder.DropColumn(
name: "Status",
table: "Locations");
migrationBuilder.DropColumn(
name: "ZipCode",
table: "Locations");
}
}
}