using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace JobTrackerApi.Migrations
{
    /// <inheritdoc />
    public partial class AddEmailDraftClientRequestId : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            if (ActiveProvider.Contains("MySql", StringComparison.OrdinalIgnoreCase))
            {
                migrationBuilder.Sql("""
                    ALTER TABLE `EmailDrafts`
                    ADD `ClientRequestId` varchar(128) NOT NULL DEFAULT '';
                    """);
                return;
            }

            migrationBuilder.AddColumn<string>(
                name: "ClientRequestId",
                table: "EmailDrafts",
                type: "TEXT",
                maxLength: 128,
                nullable: false,
                defaultValue: "");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "ClientRequestId",
                table: "EmailDrafts");
        }
    }
}
