CREATE TABLE published_pages (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    token TEXT NOT NULL UNIQUE,
    pad_id INTEGER UNIQUE REFERENCES pads(id) ON DELETE CASCADE,
    note_id INTEGER UNIQUE REFERENCES notes(id) ON DELETE CASCADE,
    created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
    CHECK ((pad_id IS NOT NULL AND note_id IS NULL) OR (pad_id IS NULL AND note_id IS NOT NULL))
);
