feat: add pageview

This commit is contained in:
KazooTTT
2024-11-23 21:09:37 +08:00
parent 4afdf7572a
commit ff5a3a50bd
9 changed files with 295 additions and 87 deletions

View File

@ -0,0 +1,11 @@
-- Create pageviews table
CREATE TABLE IF NOT EXISTS pageviews (
id INTEGER PRIMARY KEY AUTOINCREMENT,
slug TEXT NOT NULL,
views INTEGER NOT NULL DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- Create unique index on slug
CREATE UNIQUE INDEX IF NOT EXISTS idx_pageviews_slug ON pageviews(slug);