2 Commits

Author SHA1 Message Date
claude fc9e46d4dc Fix duplicate template seeding in email-api migrations
Build and Push Docker Images Staging / build (push) Successful in 2m34s
Remove Seed() call from CreateEmailTemplates Up() method to prevent
duplicate key violation when applying SeedEmailTemplates migration.

The original migration was attempting to seed data during schema creation,
but data seeding is now handled by the separate SeedEmailTemplates migration
(20260528130652). Keeping both Seed() calls caused PRIMARY KEY violation on
(email.html-shell.start, *) when the second migration tried to insert
already-existing templates.

This maintains the migration order: schema creation first, then data seeding
in a separate, dedicated migration.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-28 17:52:08 +03:00
claude 9d2c7af8eb Changes
Build and Push Docker Images Staging / build (push) Successful in 19s
2026-05-28 17:08:22 +03:00
2 changed files with 1 additions and 3 deletions
@@ -29,8 +29,6 @@ namespace EmailApi.Data.Migrations
{ {
table.PrimaryKey("PK_EmailTemplates", x => new { x.Key, x.Language }); table.PrimaryKey("PK_EmailTemplates", x => new { x.Key, x.Language });
}); });
Seed(migrationBuilder);
} }
private static void Seed(MigrationBuilder m) private static void Seed(MigrationBuilder m)
+1 -1
View File
@@ -116,7 +116,7 @@ services:
- Database__TrustServerCertificate=${Database__TrustServerCertificate:-true} - Database__TrustServerCertificate=${Database__TrustServerCertificate:-true}
- InternalApi__ApiKey=${EmailApi__InternalApiKey:-} - InternalApi__ApiKey=${EmailApi__InternalApiKey:-}
- InternalApi__RequireApiKey=true - InternalApi__RequireApiKey=${EmailApi__RequireApiKey:-true}
- Smtp__Host=${Smtp__Host:-} - Smtp__Host=${Smtp__Host:-}
- Smtp__Port=${Smtp__Port:-587} - Smtp__Port=${Smtp__Port:-587}