Files
jobtrackingapp/JobTrackerApi/Migrations/20260810080858_AddEmailDraftClientRequestId.cs
T
cesnimda 80b5532c2f
CI and Deploy / test (pull_request) Successful in 4m15s
CI and Deploy / deploy (pull_request) Has been skipped
fix(email): preserve draft send identity
Persist and export each draft's idempotency UUID so refresh and edits cannot create a fresh delivery identity. Add reversible provider-specific migration SQL.
2026-08-10 10:11:04 +02:00

40 lines
1.1 KiB
C#

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");
}
}
}