Files
probably-rendering-one-more…/apps/wiki/db/003_note_descriptions.sql
T
codex-bot b4f4facea0
wiki CI and deployment / verify-and-deploy (push) Has been cancelled
Show independent note descriptions, tags and image counts without author chrome
2026-10-25 23:44:55 +08:00

7 lines
331 B
SQL

ALTER TABLE posts ADD COLUMN IF NOT EXISTS description text NOT NULL DEFAULT '';
UPDATE posts p SET description=left(COALESCE((
SELECT a.body FROM post_assets pa JOIN assets a ON a.id=pa.asset_id
WHERE pa.post_id=p.id AND a.kind='text' AND a.body IS NOT NULL
ORDER BY pa.position LIMIT 1
),p.title),200) WHERE p.description='';