Files
FWS-DiscordBot/src/database/migrations/007-wiki.sql
T
nocodeandClaude Opus 5 ce1c0f2910 feat(wiki): serve a public documentation written from the panel
Pages live in SQLite and are read without a session: documentation nobody
can reach without an account is not documentation. Drafts answer 404 even
when their address is guessed, and the site never falls back to the
dashboard shell, which would send a visitor to a login screen.

The wiki ships with terms of use and a privacy policy written against the
revised Swiss LPD, describing table by table what this codebase actually
stores. Both are marked protected: they can be rewritten, not deleted, and
a deleted one comes back on the next start — a bot that processes personal
data must always be able to show its notice.

The bracketed details still have to be completed and the whole reviewed;
this is a starting point written from the schema, not legal advice.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 22:31:42 +02:00

22 lines
845 B
SQL

-- Public wiki pages, written from the dashboard and served without a session (M17)
CREATE TABLE IF NOT EXISTS wiki_pages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
slug TEXT NOT NULL UNIQUE,
title TEXT NOT NULL,
summary TEXT,
content TEXT NOT NULL DEFAULT '',
category TEXT NOT NULL DEFAULT 'Général',
position INTEGER NOT NULL DEFAULT 0,
published INTEGER NOT NULL DEFAULT 0,
-- A legal page is protected from deletion: the bot must always be able to
-- point at its terms and its privacy notice.
protected INTEGER NOT NULL DEFAULT 0,
created_by TEXT,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_by TEXT,
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
);
CREATE INDEX IF NOT EXISTS idx_wiki_published ON wiki_pages (published, category, position);