From db1ef84e98fa2e668abaae53b1df0731f16040cb Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 29 May 2015 08:52:58 +0200 Subject: [PATCH] Bug 14295: Database revision: add three columns to uploaded_files Content-Type: text/plain; charset=utf-8 This patch adds three columns to table uploaded_files. Col filesize will be helpful when checking quota. Col owner will be helpful in terms of optional permissions and security. Col dtcreated tells you when the file was uploaded. Test plan: Run the database revision. Run a new install or run kohastructure.sql. --- installer/data/mysql/atomicupdate/14295.sql | 5 +++++ installer/data/mysql/kohastructure.sql | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/14295.sql diff --git a/installer/data/mysql/atomicupdate/14295.sql b/installer/data/mysql/atomicupdate/14295.sql new file mode 100644 index 0000000..143217a --- /dev/null +++ b/installer/data/mysql/atomicupdate/14295.sql @@ -0,0 +1,5 @@ +ALTER TABLE uploaded_files + ADD COLUMN filesize int, + ADD COLUMN dtcreated timestamp NOT NULL default CURRENT_TIMESTAMP, + ADD COLUMN owner int, + ADD CONSTRAINT FOREIGN KEY (owner) REFERENCES borrowers (borrowernumber); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 6fc2452..98572a4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3358,7 +3358,11 @@ DROP TABLE IF EXISTS uploaded_files; CREATE TABLE uploaded_files ( id CHAR(40) NOT NULL PRIMARY KEY, filename TEXT NOT NULL, - dir TEXT NOT NULL + dir TEXT NOT NULL, + filesize int, + dtcreated timestamp NOT NULL default CURRENT_TIMESTAMP, + owner int, + FOREIGN KEY (owner) REFERENCES borrowers (borrowernumber) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 1.7.10.4