From aea0a006e50ff2bb28871b5b6ddb4ffc62fc4cea Mon Sep 17 00:00:00 2001 From: Essem Date: Sat, 18 Oct 2025 18:00:12 -0500 Subject: [PATCH] Add PDS base index --- common/db.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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...`); -- 2.51.2