Church.Net.API/Church.Net.WebAPI/DAL/Migrations/20221012223219_AddCost.cs
2025-11-02 17:05:06 -08:00

71 lines
2.7 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddCost : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Contributions",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
GroupId = table.Column<string>(type: "text", nullable: true),
Contributor = table.Column<string>(type: "text", nullable: true),
Amount = table.Column<decimal>(type: "numeric", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Contributions", x => x.Id);
table.ForeignKey(
name: "FK_Contributions_PastoralDomains_GroupId",
column: x => x.GroupId,
principalTable: "PastoralDomains",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "HappinessCosts",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
WeekId = table.Column<string>(type: "text", nullable: true),
Tasker = table.Column<string>(type: "text", nullable: true),
Content = table.Column<string>(type: "text", nullable: true),
Amount = table.Column<decimal>(type: "numeric", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessCosts", x => x.Id);
table.ForeignKey(
name: "FK_HappinessCosts_HappinessWeeks_WeekId",
column: x => x.WeekId,
principalTable: "HappinessWeeks",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Contributions_GroupId",
table: "Contributions",
column: "GroupId");
migrationBuilder.CreateIndex(
name: "IX_HappinessCosts_WeekId",
table: "HappinessCosts",
column: "WeekId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Contributions");
migrationBuilder.DropTable(
name: "HappinessCosts");
}
}
}