diff --git a/src/Meezi.API/Services/DemoSeedService.cs b/src/Meezi.API/Services/DemoSeedService.cs index 60e875d..a7c0de9 100644 --- a/src/Meezi.API/Services/DemoSeedService.cs +++ b/src/Meezi.API/Services/DemoSeedService.cs @@ -130,7 +130,10 @@ public class DemoSeedService : IDemoSeedService decimal qty, decimal reorder, decimal cost, decimal par) => new() { - Id = $"{cafeId}_ing_{Guid.NewGuid():N}"[..36], + // No [..36] truncation: Id is a text column, and truncating to 36 chars + // cuts off the unique guid for real (32-char) café ids → every row gets + // the same id → PK collision → 500. Keep the full unique id. + Id = $"{cafeId}_ing_{Guid.NewGuid():N}", CafeId = cafeId, Name = name, Unit = unit, @@ -160,7 +163,9 @@ public class DemoSeedService : IDemoSeedService string cafeId, string branchId, string number, int capacity, string floor, int sortOrder) => new() { - Id = $"{cafeId}_tbl_{Guid.NewGuid():N}"[..36], + // No [..36] truncation (see Ingredient above): truncating cuts the guid + // for real 32-char café ids → identical ids → PK collision → 500. + Id = $"{cafeId}_tbl_{Guid.NewGuid():N}", CafeId = cafeId, BranchId = branchId, Number = number,