using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace esuite.Database.SqlServer.Migrations
{
    /// <inheritdoc />
#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
    public partial class specificationforeignkey : Migration
#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language.
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateIndex(
                name: "IX_Specifications_FormInstanceId",
                schema: "Printer",
                table: "Specifications",
                column: "FormInstanceId");

            migrationBuilder.AddForeignKey(
                name: "FK_Specifications_FormInstances_FormInstanceId",
                schema: "Printer",
                table: "Specifications",
                column: "FormInstanceId",
                principalSchema: "Forms",
                principalTable: "FormInstances",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Specifications_FormInstances_FormInstanceId",
                schema: "Printer",
                table: "Specifications");

            migrationBuilder.DropIndex(
                name: "IX_Specifications_FormInstanceId",
                schema: "Printer",
                table: "Specifications");
        }
    }
}
