51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PostFundManagement.Infrastructure.Database.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddedTenantIdToOutcomes : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "TenantId",
|
|
table: "Outcomes",
|
|
type: "bigint",
|
|
nullable: false,
|
|
defaultValue: 0L);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Outcomes_TenantId",
|
|
table: "Outcomes",
|
|
column: "TenantId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Outcomes_Tenants_TenantId",
|
|
table: "Outcomes",
|
|
column: "TenantId",
|
|
principalTable: "Tenants",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Outcomes_Tenants_TenantId",
|
|
table: "Outcomes");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_Outcomes_TenantId",
|
|
table: "Outcomes");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TenantId",
|
|
table: "Outcomes");
|
|
}
|
|
}
|
|
}
|