fix: split initDb into two queries (pg no multi-command prepared stmts)
All checks were successful
Deploy to dev.bl.pixeldev.eu / deploy (push) Successful in 2s
All checks were successful
Deploy to dev.bl.pixeldev.eu / deploy (push) Successful in 2s
This commit is contained in:
parent
1ea5ac60cc
commit
1d082d9016
10
server.js
10
server.js
@ -31,10 +31,12 @@ async function initDb() {
|
|||||||
id INT PRIMARY KEY DEFAULT 1,
|
id INT PRIMARY KEY DEFAULT 1,
|
||||||
content TEXT NOT NULL DEFAULT '',
|
content TEXT NOT NULL DEFAULT '',
|
||||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
);
|
)
|
||||||
INSERT INTO card_text (id, content) VALUES (1, $1)
|
`);
|
||||||
ON CONFLICT (id) DO NOTHING;
|
await pool.query(
|
||||||
`, [DEFAULT_TEXT]);
|
`INSERT INTO card_text (id, content) VALUES (1, $1) ON CONFLICT (id) DO NOTHING`,
|
||||||
|
[DEFAULT_TEXT]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── CORS ──────────────────────────────────────────────────────────────────
|
// ── CORS ──────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user