From 926ce396d2e75af51ca3f110a0b48fd64c6ace3f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 29 May 2015 13:05:12 +0200 Subject: [PATCH] Bug 14296: Introduce upload settings [database revision] Content-Type: text/plain; charset=utf-8 This patch adds the table upload_settings. An interface for this table will be created on a subsequent report. The table will be used first to implement a check on upload size and quota. The table allows to add settings on a general level (no borrower) and on a (staff) user level overriding general settings. Test plan: Run new install or upgrade in the webinstaller. You can also run the sql files from the command line. --- installer/data/mysql/atomicupdate/14296.sql | 8 ++++++++ installer/data/mysql/kohastructure.sql | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/14296.sql diff --git a/installer/data/mysql/atomicupdate/14296.sql b/installer/data/mysql/atomicupdate/14296.sql new file mode 100644 index 0000000..9438a61 --- /dev/null +++ b/installer/data/mysql/atomicupdate/14296.sql @@ -0,0 +1,8 @@ +CREATE TABLE upload_settings ( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + borrowernumber int, + type enum('filesize','itemquota','spacequota') NOT NULL, + count1 int, + count2 int, + FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 98572a4..9086f51 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3351,6 +3351,20 @@ CREATE TABLE IF NOT EXISTS `borrower_modifications` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- +-- Table structure for table upload_settings +-- + +DROP TABLE IF EXISTS upload_settings; +CREATE TABLE upload_settings ( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + borrowernumber int, + type enum('filesize','itemquota','spacequota') NOT NULL, + count1 int, -- number of bytes or items + count2 int, -- number of days for quota + FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- -- Table structure for table uploaded_files -- -- 1.7.10.4