142 lines
4.9 KiB
C#
142 lines
4.9 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Church.Net.DAL.EFCoreDBF.Migrations
|
|
{
|
|
public partial class MergeHappinessGroup : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_HappinessBESTs_HappinessGroups_GroupId",
|
|
table: "HappinessBESTs");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_HappinessWeeks_HappinessGroups_GroupId",
|
|
table: "HappinessWeeks");
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "ServiceTime",
|
|
table: "PastoralDomains",
|
|
type: "timestamp with time zone",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "Type",
|
|
table: "PastoralDomains",
|
|
type: "integer",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "HappinessGroupId",
|
|
table: "HappinessWeeks",
|
|
type: "text",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "HappinessGroupId",
|
|
table: "HappinessBESTs",
|
|
type: "text",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_HappinessWeeks_HappinessGroupId",
|
|
table: "HappinessWeeks",
|
|
column: "HappinessGroupId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_HappinessBESTs_HappinessGroupId",
|
|
table: "HappinessBESTs",
|
|
column: "HappinessGroupId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_HappinessBESTs_HappinessGroups_HappinessGroupId",
|
|
table: "HappinessBESTs",
|
|
column: "HappinessGroupId",
|
|
principalTable: "HappinessGroups",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_HappinessBESTs_PastoralDomains_GroupId",
|
|
table: "HappinessBESTs",
|
|
column: "GroupId",
|
|
principalTable: "PastoralDomains",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_HappinessWeeks_HappinessGroups_HappinessGroupId",
|
|
table: "HappinessWeeks",
|
|
column: "HappinessGroupId",
|
|
principalTable: "HappinessGroups",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_HappinessWeeks_PastoralDomains_GroupId",
|
|
table: "HappinessWeeks",
|
|
column: "GroupId",
|
|
principalTable: "PastoralDomains",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_HappinessBESTs_HappinessGroups_HappinessGroupId",
|
|
table: "HappinessBESTs");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_HappinessBESTs_PastoralDomains_GroupId",
|
|
table: "HappinessBESTs");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_HappinessWeeks_HappinessGroups_HappinessGroupId",
|
|
table: "HappinessWeeks");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_HappinessWeeks_PastoralDomains_GroupId",
|
|
table: "HappinessWeeks");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_HappinessWeeks_HappinessGroupId",
|
|
table: "HappinessWeeks");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_HappinessBESTs_HappinessGroupId",
|
|
table: "HappinessBESTs");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ServiceTime",
|
|
table: "PastoralDomains");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Type",
|
|
table: "PastoralDomains");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "HappinessGroupId",
|
|
table: "HappinessWeeks");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "HappinessGroupId",
|
|
table: "HappinessBESTs");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_HappinessBESTs_HappinessGroups_GroupId",
|
|
table: "HappinessBESTs",
|
|
column: "GroupId",
|
|
principalTable: "HappinessGroups",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_HappinessWeeks_HappinessGroups_GroupId",
|
|
table: "HappinessWeeks",
|
|
column: "GroupId",
|
|
principalTable: "HappinessGroups",
|
|
principalColumn: "Id");
|
|
}
|
|
}
|
|
}
|