aurweb/upgrading/4.6.0.txt
Lukas Fleischer 016b40f99d Render comments when storing them in the database
Instead of converting package comments from plain text to HTML code when
they are displayed, do the conversion when the comment is posted and
store the rendered result in the database. The conversion itself is done
by a Python script which uses Bleach for sanitizing the text.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-23 18:43:26 +02:00

17 lines
549 B
Text

1. Add DepDesc column to PackageDepends and split dependency names:
---
ALTER TABLE PackageDepends ADD COLUMN DepDesc VARCHAR(255) NULL DEFAULT NULL;
UPDATE PackageDepends
SET DepDesc = SUBSTRING(DepName FROM POSITION(': ' IN DepName) + 2)
WHERE POSITION(': ' IN DepName) > 0;
UPDATE PackageDepends
SET DepName = SUBSTRING(DepName FROM 1 FOR POSITION(': ' IN DepName) - 1)
WHERE POSITION(': ' IN DepName) > 0;
---
2. Add RenderedComment column to PackageComments:
---
ALTER TABLE PackageComments ADD COLUMN RenderedComment TEXT NOT NULL;
---