post fields improvements

This commit is contained in:
Michael Freno
2025-12-29 17:47:35 -05:00
parent ec4a895016
commit 2852c0b450
3 changed files with 49 additions and 8 deletions

View File

@@ -20,12 +20,13 @@ export const model: { [key: string]: string } = {
subtitle TEXT,
body TEXT NOT NULL,
banner_photo TEXT,
date TEXT NOT NULL DEFAULT (datetime('now')),
date TEXT,
published INTEGER NOT NULL,
category TEXT,
author_id TEXT NOT NULL,
reads INTEGER NOT NULL DEFAULT 0,
attachments TEXT
attachments TEXT,
last_edited_date TEXT
);
CREATE INDEX IF NOT EXISTS idx_posts_category ON Post (category);
`,

View File

@@ -22,11 +22,12 @@ export interface Post {
subtitle?: string;
body: string;
banner_photo?: string;
date: string;
date?: string | null;
published: boolean;
author_id: string;
reads: number;
attachments?: string;
last_edited_date?: string | null;
}
export interface PostLike {
@@ -72,13 +73,14 @@ export interface PostWithCommentsAndLikes {
subtitle: string;
body: string;
banner_photo: string;
date: string;
date?: string | null;
published: boolean;
author_id: string;
reads: number;
attachments: string;
total_likes: number;
total_comments: number;
last_edited_date?: string | null;
}
export interface PostWithTags {
id: number;
@@ -87,10 +89,11 @@ export interface PostWithTags {
subtitle: string;
body: string;
banner_photo: string;
date: string;
date?: string | null;
published: boolean;
author_id: string;
reads: number;
attachments: string;
tags: Tag[];
last_edited_date?: string | null;
}