perf improvements

This commit is contained in:
2026-01-04 14:53:30 -05:00
parent 111712e969
commit a620a9f4c5
10 changed files with 303 additions and 1750 deletions

View File

@@ -63,6 +63,9 @@ export const model: { [key: string]: string } = {
last_edited_date TEXT
);
CREATE INDEX IF NOT EXISTS idx_posts_category ON Post (category);
CREATE INDEX IF NOT EXISTS idx_posts_published ON Post (published);
CREATE INDEX IF NOT EXISTS idx_posts_date ON Post (date);
CREATE INDEX IF NOT EXISTS idx_posts_published_date ON Post (published, date);
`,
PostLike: `
CREATE TABLE PostLike
@@ -72,6 +75,7 @@ export const model: { [key: string]: string } = {
post_id INTEGER NOT NULL
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_likes_user_post ON PostLike (user_id, post_id);
CREATE INDEX IF NOT EXISTS idx_likes_post_id ON PostLike (post_id);
`,
Comment: `
CREATE TABLE Comment