using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MyOffice.Migrations.Postgres.Migrations
{
    /// <inheritdoc />
    public partial class CurrentRateV2 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "CurrentRateId",
                table: "Currencies",
                type: "integer",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Currencies_CurrentRateId",
                table: "Currencies",
                column: "CurrentRateId");

            migrationBuilder.AddForeignKey(
                name: "FK_Currencies_CurrencyRates_CurrentRateId",
                table: "Currencies",
                column: "CurrentRateId",
                principalTable: "CurrencyRates",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Currencies_CurrencyRates_CurrentRateId",
                table: "Currencies");

            migrationBuilder.DropIndex(
                name: "IX_Currencies_CurrentRateId",
                table: "Currencies");

            migrationBuilder.DropColumn(
                name: "CurrentRateId",
                table: "Currencies");
        }
    }
}
