using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace esuite.Database.SqlServer.Migrations
{
    /// <inheritdoc />
    public partial class AddCustomFieldText : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "CustomFieldTexts",
                schema: "CustomFields",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CustomFieldId = table.Column<long>(type: "bigint", nullable: false),
                    MultiLine = table.Column<bool>(type: "bit", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CustomFieldTexts", x => x.Id);
                    table.ForeignKey(
                        name: "FK_CustomFieldTexts_CustomFields_CustomFieldId",
                        column: x => x.CustomFieldId,
                        principalSchema: "CustomFields",
                        principalTable: "CustomFields",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_CustomFieldTexts_CustomFieldId",
                schema: "CustomFields",
                table: "CustomFieldTexts",
                column: "CustomFieldId");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CustomFieldTexts",
                schema: "CustomFields");
        }
    }
}
