From 44d52fe8751c58772b2ee0ec6e92feba952d7a23 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Aug 2015 14:48:35 +0100 Subject: [PATCH] Bug 14544: DB Changes: Set a default value for sortfield Content-Type: text/plain; charset=utf-8 Signed-off-by: Alex Arnaud Signed-off-by: Marcel de Rooy --- .../bug_14544_set_default_value_for_virtualshelves_sortfield.sql | 3 +++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_14544_set_default_value_for_virtualshelves_sortfield.sql diff --git a/installer/data/mysql/atomicupdate/bug_14544_set_default_value_for_virtualshelves_sortfield.sql b/installer/data/mysql/atomicupdate/bug_14544_set_default_value_for_virtualshelves_sortfield.sql new file mode 100644 index 0000000..9137425 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_14544_set_default_value_for_virtualshelves_sortfield.sql @@ -0,0 +1,3 @@ +ALTER TABLE virtualshelves CHANGE COLUMN sortfield sortfield VARCHAR(16) DEFAULT 'title'; + +UPDATE virtualshelves SET sortfield='title' WHERE sortfield IS NULL; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 9efa8ad..a7707a8 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2290,7 +2290,7 @@ CREATE TABLE `virtualshelves` ( -- information about lists (or virtual shelves) `shelfname` varchar(255) default NULL, -- name of the list `owner` int default NULL, -- foreign key linking to the borrowers table (using borrowernumber) for the creator of this list (changed from varchar(80) to int) `category` varchar(1) default NULL, -- type of list (private [1], public [2]) - `sortfield` varchar(16) default NULL, -- the field this list is sorted on + `sortfield` varchar(16) default 'title', -- the field this list is sorted on `lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time the list was last modified `created_on` TIMESTAMP NOT NULL, -- creation time `allow_add` tinyint(1) default 0, -- permission for adding entries to list -- 1.7.10.4