From 44858e06188946c0082bb09061fcfa6cbb33938b Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 19 Apr 2017 08:53:30 +0200 Subject: Store dependency descriptions in a separate column 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 Signed-off-by: Lukas Fleischer --- upgrading/4.6.0.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 upgrading/4.6.0.txt (limited to 'upgrading/4.6.0.txt') diff --git a/upgrading/4.6.0.txt b/upgrading/4.6.0.txt new file mode 100644 index 00000000..45740f40 --- /dev/null +++ b/upgrading/4.6.0.txt @@ -0,0 +1,11 @@ +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; +--- -- cgit v1.2.3-24-g4f1b