Commit f937601
fix(data): fix Npgsql migrations and suppress PendingModelChangesWarning (#249)
Two bugs caught by Docker Compose sanity check of the PostgreSQL path.
- Populate BuildTargetModel in Npgsql seed migration designer files
so Npgsql's SQL generator can resolve column types when applying
InsertData operations (SeedStarting11, SeedSubstitutes)
- Suppress PendingModelChangesWarning for the postgres provider path
via ConfigureWarnings; hand-crafted designer files cannot replicate
Npgsql-injected runtime annotations (Relational:MaxIdentifierLength,
UseIdentityByDefaultColumn), causing a false-positive that aborted
MigrateAsync() at startup; BuildTargetModel is still populated so
InsertData SQL generation continues to work correctly
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e52abca commit f937601
4 files changed
Lines changed: 115 additions & 5 deletions
File tree
- src/Dotnet.Samples.AspNetCore.WebApi
- Extensions
- Migrations/Npgsql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
Lines changed: 50 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 50 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments