This commit is contained in:
2023-06-19 20:47:37 +08:00
parent 3ef7d38526
commit e6a6fe6001

7
db.ts
View File

@@ -473,7 +473,6 @@ export class EhDb {
const c = this.db.query<[number]>(
`SELECT COUNT(*) FROM "${name}";`,
)[0][0];
console.log(c);
if (c !== count) {
const d = this.db.query<[number]>(`SELECT id FROM "${name}";`);
d.forEach((d, i) => {
@@ -483,6 +482,12 @@ export class EhDb {
`UPDATE "${name}" SET id = ? WHERE id = ?;`,
[r, d[0]],
);
if (name === "tag") {
this.db.query(
"UPDATE gtag SET id = ? WHERE id = ?;",
[r, d[0]],
);
}
}
});
this.db.query(