From 51ebcdbc4053b2654c6958f7c6b60e4b6969a531 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 6 Aug 2015 15:34:57 +0200 Subject: [PATCH] Bug 14321: Add two columns to uploaded_files This patch adds uploaded_files.public and permanent. Public will be used later to mark uploaded files as available via OPAC. Permanent will be used to make the distinction between temporary and permanent storage. The db rev sets both flags for all current records (uploaded via the plugin from BZ 6874). Test plan: [1] If you tested this before, drop the column public first. [1] Run the dbrev. Signed-off-by: Mirko Tietgen --- installer/data/mysql/atomicupdate/14321a_public.sql | 5 +++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/14321a_public.sql diff --git a/installer/data/mysql/atomicupdate/14321a_public.sql b/installer/data/mysql/atomicupdate/14321a_public.sql new file mode 100644 index 0000000..ef251d8 --- /dev/null +++ b/installer/data/mysql/atomicupdate/14321a_public.sql @@ -0,0 +1,5 @@ +ALTER TABLE uploaded_files + ADD COLUMN public tinyint, + ADD COLUMN permanent tinyint; +-- Any records already there are public and permanent storage +UPDATE uploaded_files SET public=1, permanent=1; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index fd58258..21c6d6c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3361,6 +3361,8 @@ CREATE TABLE uploaded_files ( dtcreated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, categorycode tinytext, owner int(11), + public tinyint, + permanent tinyint, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- 1.7.10.4