mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
17 lines
549 B
Text
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;
|
|
---
|