Add published_at to entries, begin to support pagination

Articles will be sorted by their published_at dates for now.
This commit is contained in:
2023-06-08 01:20:21 -04:00
parent 3f29138bd1
commit 758e644173
6 changed files with 106 additions and 36 deletions

View File

@@ -20,9 +20,10 @@ CREATE TABLE IF NOT EXISTS "entries" (
"description" TEXT,
"html_content" TEXT,
"feed_id" INTEGER REFERENCES "feeds"(id) NOT NULL,
"published_at" timestamp(3) NOT NULL,
"created_at" timestamp(3) NOT NULL,
"updated_at" timestamp(3) NOT NULL,
"deleted_at" timestamp(3)
);
CREATE INDEX "entries_deleted_at" ON "entries" ("deleted_at");
CREATE INDEX "entries_published_at_where_deleted_at_is_null" ON "entries" ("published_at" DESC) WHERE "deleted_at" IS NULL;
CREATE UNIQUE INDEX "entries_url_and_feed_id" ON "entries" ("url", "feed_id");