mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Split optional dependency descriptions from dependency names before storing them in the database and use a separate column to store the descriptions. This allows us to simplify and optimize the SQL queries in pkg_dependencies() as well as pkg_required(). Suggested-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
11 lines
419 B
Text
11 lines
419 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;
|
|
---
|