using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BankYouBankruptDatabaseImplement.Migrations
{
///
public partial class NewSmallFix : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_MoneyTransfers_Accounts_AccountSenderId",
table: "MoneyTransfers");
migrationBuilder.DropForeignKey(
name: "FK_MoneyTransfers_Creditings_CreditingId",
table: "MoneyTransfers");
migrationBuilder.AlterColumn(
name: "CreditingId",
table: "MoneyTransfers",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn(
name: "AccountSenderId",
table: "MoneyTransfers",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AddForeignKey(
name: "FK_MoneyTransfers_Accounts_AccountSenderId",
table: "MoneyTransfers",
column: "AccountSenderId",
principalTable: "Accounts",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_MoneyTransfers_Creditings_CreditingId",
table: "MoneyTransfers",
column: "CreditingId",
principalTable: "Creditings",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_MoneyTransfers_Accounts_AccountSenderId",
table: "MoneyTransfers");
migrationBuilder.DropForeignKey(
name: "FK_MoneyTransfers_Creditings_CreditingId",
table: "MoneyTransfers");
migrationBuilder.AlterColumn(
name: "CreditingId",
table: "MoneyTransfers",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "AccountSenderId",
table: "MoneyTransfers",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_MoneyTransfers_Accounts_AccountSenderId",
table: "MoneyTransfers",
column: "AccountSenderId",
principalTable: "Accounts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_MoneyTransfers_Creditings_CreditingId",
table: "MoneyTransfers",
column: "CreditingId",
principalTable: "Creditings",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}