106 lines
3.7 KiB
C#
106 lines
3.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Church.Net.DAL.EFCoreDBF.Migrations
|
|
{
|
|
public partial class AddLineId : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "LineAccountId",
|
|
table: "PastoralDomains",
|
|
type: "text",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "LineAccountId",
|
|
table: "HappinessGroups",
|
|
type: "text",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "PastoralDomainId",
|
|
table: "CellGroupRoutineEvents",
|
|
type: "text",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_PastoralDomains_LineAccountId",
|
|
table: "PastoralDomains",
|
|
column: "LineAccountId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_HappinessGroups_LineAccountId",
|
|
table: "HappinessGroups",
|
|
column: "LineAccountId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CellGroupRoutineEvents_PastoralDomainId",
|
|
table: "CellGroupRoutineEvents",
|
|
column: "PastoralDomainId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_CellGroupRoutineEvents_PastoralDomains_PastoralDomainId",
|
|
table: "CellGroupRoutineEvents",
|
|
column: "PastoralDomainId",
|
|
principalTable: "PastoralDomains",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_HappinessGroups_LineMessagingAccounts_LineAccountId",
|
|
table: "HappinessGroups",
|
|
column: "LineAccountId",
|
|
principalTable: "LineMessagingAccounts",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_PastoralDomains_LineMessagingAccounts_LineAccountId",
|
|
table: "PastoralDomains",
|
|
column: "LineAccountId",
|
|
principalTable: "LineMessagingAccounts",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_CellGroupRoutineEvents_PastoralDomains_PastoralDomainId",
|
|
table: "CellGroupRoutineEvents");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_HappinessGroups_LineMessagingAccounts_LineAccountId",
|
|
table: "HappinessGroups");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_PastoralDomains_LineMessagingAccounts_LineAccountId",
|
|
table: "PastoralDomains");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_PastoralDomains_LineAccountId",
|
|
table: "PastoralDomains");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_HappinessGroups_LineAccountId",
|
|
table: "HappinessGroups");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_CellGroupRoutineEvents_PastoralDomainId",
|
|
table: "CellGroupRoutineEvents");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "LineAccountId",
|
|
table: "PastoralDomains");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "LineAccountId",
|
|
table: "HappinessGroups");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PastoralDomainId",
|
|
table: "CellGroupRoutineEvents");
|
|
}
|
|
}
|
|
}
|