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( name: "Comment", table: "HappinessWeeks", type: "text", nullable: true); migrationBuilder.CreateTable( name: "HappinessTask", columns: table => new { Id = table.Column(type: "text", nullable: false), WeekId = table.Column(type: "text", nullable: true), Type = table.Column(type: "integer", nullable: false), Tasker = table.Column(type: "text", nullable: true), Content = table.Column(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"); } } }