Commit b80c3dd
committed
Fix PostgreSQL sequence reset for test fixtures
PostgreSQL sequences don't auto-increment when inserting records with
explicit IDs, causing duplicate key violations on subsequent
auto-increment inserts in fresh test environments. This was masked
locally by "warmed up" sequences from previous test runs but failed
consistently in CI with fresh databases.
Reset sequences to MAX(id) after buildFixtures() inserts hardcoded IDs
to ensure next auto-increment returns correct value. Also add InnoDB
engine and strict mode to MySQL connection for better test reliability.1 parent 0245411 commit b80c3dd
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
125 | 137 | | |
126 | 138 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
0 commit comments