Commit b9d67e8
run-migrations: include details from Postgres errors (getodk#1415)
Noticed while working on getodk#1363.
Currently, when a postgres error has additional details, `run-migrations.js` will swallow these details.
# Example
## migration
```js
module.exports = {
down: () => {},
up: db => db.raw(`
INSERT INTO config (key) VALUES('a');
INSERT INTO config (key) VALUES('a');
`),
}
```
## logging - previous `master`
```
Error: INSERT INTO config (key) VALUES('a'); INSERT INTO config (key) VALUES('a') - duplicate key value violates unique constraint "config_pkey"
```
## logging - this commit
```
Error: INSERT INTO config (key) VALUES('a'); INSERT INTO config (key) VALUES('a') - duplicate key value violates unique constraint "config_pkey" (Key (key)=(a) already exists.)
```1 parent cdf8e15 commit b9d67e8
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
0 commit comments