fix(migrations): добавить [Migration] атрибут для Phase5c — без него Migrate() не находит миграцию
Some checks are pending
CI / POS (WPF, Windows) (push) Waiting to run
CI / Backend (.NET 8) (push) Successful in 55s
CI / Web (React + Vite) (push) Successful in 42s
Docker API / Build + push API (push) Successful in 1m17s
Docker API / Deploy API on stage (push) Successful in 18s

stage api зашёл в crash-loop после деплоя phase5c: DevDataSeeder упал
с «column IsActive does not exist», потому что миграция Phase5c не
была подхвачена db.Database.Migrate(). EF Core ищет миграции по
[MigrationAttribute] на классе (или Designer-файле, который этот
атрибут содержит). Без него миграция в сборке есть, но не известна
runtime-механизму.

Также чиню e2e: URL единиц был /api/catalog/units (404), правильный —
/api/catalog/units-of-measure.
This commit is contained in:
nns 2026-05-08 01:29:51 +05:00
parent 493ed33fd0
commit ee127b2785
2 changed files with 5 additions and 1 deletions

View file

@ -1,4 +1,6 @@
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using foodmarket.Infrastructure.Persistence;
#nullable disable
@ -22,6 +24,8 @@ namespace foodmarket.Infrastructure.Persistence.Migrations
///
/// Безопасно для prod: products FK (OnDelete=Restrict) не падает
/// благодаря шагу 3 перед DELETE на шаге 4.</summary>
[DbContext(typeof(AppDbContext))]
[Migration("20260508000000_Phase5c_UnitsOfMeasureGlobal")]
public partial class Phase5c_UnitsOfMeasureGlobal : Migration
{
protected override void Up(MigrationBuilder b)

View file

@ -459,7 +459,7 @@ export async function step08_create_supply({ ctx, step, report }: StepCtx) {
if (items.length < 3) {
report.gap('Реестр products tenant-scoped: новая org стартует с пустым каталогом, хотя в БД лежат products другой org. e2e-сценарий компенсирует созданием 3 products через API.')
// Получим первую unit-of-measure (системную или из org).
const unitsRes = await api.get('/api/catalog/units?pageSize=10')
const unitsRes = await api.get('/api/catalog/units-of-measure?pageSize=10')
const unit = (unitsRes.data?.items ?? [])[0] as { id: string; name: string } | undefined
if (!unit) {
report.bug({