diff --git a/common/db.ts b/common/db.ts index 35d71de..6e63252 100644 --- a/common/db.ts +++ b/common/db.ts @@ -26,7 +26,8 @@ const schema = [ DROP INDEX posts_indexed_idx; CREATE INDEX posts_indexed_idx ON posts(indexed_at DESC, cid DESC, uri); DROP INDEX posts_author_idx; - CREATE INDEX posts_author_idx ON posts (author, indexed_at DESC, cid DESC, uri);` + CREATE INDEX posts_author_idx ON posts (author, indexed_at DESC, cid DESC, uri);`, + `CREATE INDEX IF NOT EXISTS authors_pds_base_idx ON authors (pds_base, did);` ]; const db = new Database(Deno.env.get("DB") ?? ":memory:", { @@ -46,7 +47,7 @@ try { const latestVersion = schema.length; if (version < latestVersion) { console.log( - `Migrating database, which is currently at version ${version}...` + `Migrating database, which is currently at version ${version - 1}...` ); while (version < latestVersion) { console.log(`Running version ${version} update script...`);