using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Managing.Infrastructure.Databases.Migrations
{
///
public partial class AddUserIdToMoneyManagement : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "UserId",
table: "MoneyManagements",
type: "integer",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_MoneyManagements_UserId",
table: "MoneyManagements",
column: "UserId");
migrationBuilder.AddForeignKey(
name: "FK_MoneyManagements_Users_UserId",
table: "MoneyManagements",
column: "UserId",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_MoneyManagements_Users_UserId",
table: "MoneyManagements");
migrationBuilder.DropIndex(
name: "IX_MoneyManagements_UserId",
table: "MoneyManagements");
migrationBuilder.DropColumn(
name: "UserId",
table: "MoneyManagements");
}
}
}