using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WarehouseAppSHIPS.Migrations
{
    /// <inheritdoc />
    public partial class HubungkanCPANkeMaterial : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "MaterialId",
                table: "ProcurementRequests",
                type: "int",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_ProcurementRequests_MaterialId",
                table: "ProcurementRequests",
                column: "MaterialId");

            migrationBuilder.AddForeignKey(
                name: "FK_ProcurementRequests_Materials_MaterialId",
                table: "ProcurementRequests",
                column: "MaterialId",
                principalTable: "Materials",
                principalColumn: "Id");
        }

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

            migrationBuilder.DropIndex(
                name: "IX_ProcurementRequests_MaterialId",
                table: "ProcurementRequests");

            migrationBuilder.DropColumn(
                name: "MaterialId",
                table: "ProcurementRequests");
        }
    }
}
