fix: always updated all articles

This commit is contained in:
Keisuke Hirata 2024-09-07 02:48:22 +09:00
parent 005fd864b2
commit 4a7960f183
2 changed files with 3 additions and 2 deletions

1
articles Submodule

@ -0,0 +1 @@
Subproject commit 3744bd78995594e5fdfcaeff32f426f1d41daffa

View File

@ -141,8 +141,8 @@ export default async function init(db: Postgres) {
'insert into article (id, title, category, released_at, updated_at, tags, image, publish, content) values ($1, $2, $3, $4, $5, $6, $7, $8, $9)', 'insert into article (id, title, category, released_at, updated_at, tags, image, publish, content) values ($1, $2, $3, $4, $5, $6, $7, $8, $9)',
[id, title, category, released_at, updated_at, tags, image, publish, content] [id, title, category, released_at, updated_at, tags, image, publish, content]
); );
// } else if (res.rows[0].updated_at < updated_at) { } else if (res.rows[0].updated_at < updated_at) {
} else if (true) { // } else if (true) {
console.log(`Update article: ${id}`); console.log(`Update article: ${id}`);
await db.query( await db.query(
'update article set title = $2, category = $3, released_at = $4, updated_at = $5, tags = $6, image = $7, publish = $8, content = $9 where id = $1', 'update article set title = $2, category = $3, released_at = $4, updated_at = $5, tags = $6, image = $7, publish = $8, content = $9 where id = $1',