mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-22 18:21:33 +08:00
feat: add pageview
This commit is contained in:
11
migrations/0000_create_pageviews.sql
Normal file
11
migrations/0000_create_pageviews.sql
Normal 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);
|
Reference in New Issue
Block a user