Church.Net.API/Church.Net.DAL.EFCoreDBF/Migrations/20220914151710_AddTaskToHappinessWeek.cs
2022-09-30 09:40:42 -07:00

54 lines
1.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddTaskToHappinessWeek : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Comment",
table: "HappinessWeeks",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "HappinessTask",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
WeekId = table.Column<string>(type: "text", nullable: true),
Type = table.Column<int>(type: "integer", nullable: false),
Tasker = table.Column<string>(type: "text", nullable: true),
Content = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessTask", x => x.Id);
table.ForeignKey(
name: "FK_HappinessTask_HappinessWeeks_WeekId",
column: x => x.WeekId,
principalTable: "HappinessWeeks",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_HappinessTask_WeekId",
table: "HappinessTask",
column: "WeekId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "HappinessTask");
migrationBuilder.DropColumn(
name: "Comment",
table: "HappinessWeeks");
}
}
}