fix: missing on conflict clause

This commit is contained in:
iCrawl
2023-11-13 21:09:43 +01:00
parent c4767bacde
commit 25d552b318

View File

@@ -20,7 +20,7 @@ for await (const file of globber.globGenerator()) {
const data = await readFile(file, 'utf8');
try {
console.log(`Uploading ${file} with ${version}...`);
await pool.sql`insert into documentation (version, data) values (${version}, ${data}) on conflict (version) do update set data = EXCLUDED.data`;
await pool.sql`insert into documentation (version, data) values (${version}, ${data}) on conflict (name, version) do update set data = EXCLUDED.data`;
} catch (error) {
const err = error as Error;
setFailed(err.message);