feat: add posts_per_page column to sites table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Leon Mika 2026-03-22 14:26:09 +11:00
parent 7c4dc0885e
commit 9b36a35c1a
4 changed files with 35 additions and 24 deletions

View file

@ -14,15 +14,16 @@ INSERT INTO sites (
title,
tagline,
timezone,
posts_per_page,
created_at
) VALUES (?, ?, ?, ?, ?, ?)
) VALUES (?, ?, ?, ?, ?, ?, ?)
RETURNING id;
-- name: HasUsersAndSites :one
SELECT (SELECT COUNT(*) FROM users) > 0 AND (SELECT COUNT(*) FROM sites) > 0 AS has_users_and_sites;
-- name: UpdateSite :exec
UPDATE sites SET title = ?, tagline = ?, timezone = ? WHERE id = ?;
UPDATE sites SET title = ?, tagline = ?, timezone = ?, posts_per_page = ? WHERE id = ?;
-- name: SelectAllSitesWithOwners :many
SELECT s.id, s.guid, s.title, s.owner_id, u.username

View file

@ -0,0 +1 @@
ALTER TABLE sites ADD COLUMN posts_per_page INTEGER NOT NULL DEFAULT 10;