Fix Surah seed tracking conflict on API startup retries.
build-and-deploy / deploy (push) Has been cancelled

Use idempotent seed, fresh DbContext per retry, and explicit Surah/Tafsir keys.
This commit is contained in:
2026-10-09 22:57:27 +03:30
parent ae746d65ba
commit 92a2fdf6bc
6 changed files with 472 additions and 31 deletions
@@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TafsirQuran.Infrastructure.Persistence.Migrations
{
/// <inheritdoc />
public partial class SurahExplicitIds : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "Surahs",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("SqlServer:Identity", "1, 1");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "Surahs",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("SqlServer:Identity", "1, 1");
}
}
}