feat(pages): add pages table schema and sqlc queries
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
620ab6c6fa
commit
f17597e4b8
4 changed files with 284 additions and 0 deletions
17
sql/schema/06_pages.up.sql
Normal file
17
sql/schema/06_pages.up.sql
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
CREATE TABLE pages (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
site_id INTEGER NOT NULL,
|
||||
guid TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
slug TEXT NOT NULL,
|
||||
body TEXT NOT NULL,
|
||||
page_type INTEGER NOT NULL DEFAULT 0,
|
||||
show_in_nav INTEGER NOT NULL DEFAULT 0,
|
||||
sort_order INTEGER NOT NULL DEFAULT 0,
|
||||
created_at INTEGER NOT NULL,
|
||||
updated_at INTEGER NOT NULL,
|
||||
FOREIGN KEY (site_id) REFERENCES sites (id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX idx_pages_site ON pages (site_id);
|
||||
CREATE UNIQUE INDEX idx_pages_guid ON pages (guid);
|
||||
CREATE UNIQUE INDEX idx_pages_site_slug ON pages (site_id, slug);
|
||||
Loading…
Add table
Add a link
Reference in a new issue