Skip to content

Commit be21405

Browse files
nanotaboadaclaude
andcommitted
fix(data): exclude Lo Celso from seed data, keep as Create/Delete fixture (#435)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9a04c82 commit be21405

3 files changed

Lines changed: 2 additions & 29 deletions

File tree

src/Dotnet.Samples.AspNetCore.WebApi/Migrations/20260329000000_NormalizePlayerDataset.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
9393
"UPDATE Players SET Id = '79c96f29-c59f-5f98-96b8-3a5946246624' WHERE SquadNumber = 22"
9494
);
9595

96-
// Insert Lo Celso (squad 27) — OR IGNORE is safe on a fresh DB where SeedSubstitutes
97-
// already seeded him (because GetSubstitutesWithId() now includes him), and required
98-
// for an existing DB that was seeded before this migration was added.
99-
migrationBuilder.Sql(
100-
"INSERT OR IGNORE INTO \"Players\" (\"Id\", \"FirstName\", \"MiddleName\", \"LastName\", \"DateOfBirth\", \"SquadNumber\", \"Position\", \"AbbrPosition\", \"Team\", \"League\", \"Starting11\") "
101-
+ "VALUES ('F8D13028-0D22-5513-8774-08A2332B5814', 'Giovani', NULL, 'Lo Celso', '1996-04-09 00:00:00', 27, 'Central Midfield', 'CM', 'Real Betis Balompié', 'La Liga', 0)"
102-
);
10396
}
10497

10598
/// <inheritdoc />
10699
protected override void Down(MigrationBuilder migrationBuilder)
107100
{
108-
// Remove Lo Celso (squad 27)
109-
migrationBuilder.DeleteData(
110-
table: "Players",
111-
keyColumn: "Id",
112-
keyValue: Guid.Parse("f8d13028-0d22-5513-8774-08a2332b5814")
113-
);
114-
115101
// Revert team/league corrections
116102
migrationBuilder.Sql(
117103
"UPDATE Players SET Team = 'Chelsea FC', League = 'Premier League' WHERE SquadNumber = 24"

src/Dotnet.Samples.AspNetCore.WebApi/Utilities/PlayerData.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ public static List<Player> GetSubstitutes()
540540
}
541541

542542
/// <summary>
543-
/// Create a predefined list of 16 substitute players where each player has a fixed GUID identifier and full profile data.
543+
/// Create a predefined list of 15 substitute players where each player has a fixed GUID identifier and full profile data.
544544
/// </summary>
545-
/// <returns>A list of 16 Player instances representing substitute players; each entry includes a predefined Id (Guid) and populated fields such as name, date of birth, squad number, position (and abbreviation), team, league, and Starting11 set to false.</returns>
545+
/// <returns>A list of 15 Player instances representing substitute players (squads 1–26); each entry includes a predefined Id (Guid) and populated fields such as name, date of birth, squad number, position (and abbreviation), team, league, and Starting11 set to false. Lo Celso (squad 27) is intentionally excluded — his squad number falls outside the seeded range so he can serve as the canonical Create/Delete fixture without conflicting with seeded data.</returns>
546546
public static List<Player> GetSubstitutesWithId()
547547
{
548548
return
@@ -754,19 +754,6 @@ public static List<Player> GetSubstitutesWithId()
754754
League = "Serie A",
755755
Starting11 = false,
756756
},
757-
new()
758-
{
759-
Id = Guid.Parse("f8d13028-0d22-5513-8774-08a2332b5814"),
760-
FirstName = "Giovani",
761-
LastName = "Lo Celso",
762-
DateOfBirth = new DateTime(1996, 4, 9, 0, 0, 0, DateTimeKind.Utc),
763-
SquadNumber = 27,
764-
Position = Position.CentralMidfield.Text,
765-
AbbrPosition = Position.CentralMidfield.Abbr,
766-
Team = "Real Betis Balompié",
767-
League = "La Liga",
768-
Starting11 = false,
769-
},
770757
];
771758
}
772759

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)