From 4615155a5257666a4a8e91d774db2680240f8a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20H=C3=B6hn?= Date: Tue, 28 Oct 2014 06:18:11 +0100 Subject: [PATCH] add preliminary scheme for zotero_www database --- www.sql | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 www.sql diff --git a/www.sql b/www.sql new file mode 100644 index 0000000..5fc8fc4 --- /dev/null +++ b/www.sql @@ -0,0 +1,74 @@ +-- ***** BEGIN LICENSE BLOCK ***** +-- +-- This file is part of the fork of the vanilla Zotero Data Server. +-- +-- Copyright © 2014 Patrick Höhn +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +-- +-- ***** END LICENSE BLOCK ***** + +CREATE TABLE `sessions` ( +`userID` int(10) unsigned NOT NULL, +`id` int(10) unsigned NOT NULL, +`dateModified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +`lifetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +KEY (`userID`), +KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `user_email` ( +`userID` int(10) unsigned NOT NULL, +`email` varchar(255) NOT NULL, +PRIMARY KEY (`userID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `storage_institutions` ( +`storageQuota` mediumint(8) unsigned NOT NULL, +`domain` varchar(255) NOT NULL, +`institutionID` int(10) unsigned NOT NULL, +PRIMARY KEY (`institutionID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `storage_institution_email` ( +`email` varchar(255) NOT NULL, +`institutionID` int(10) unsigned NOT NULL, +PRIMARY KEY (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `users` ( +`userID` int(10) unsigned NOT NULL, +`username` varchar(255) NOT NULL, +`password` char(40) NULL, +UNIQUE KEY (`username`), +UNIQUE KEY (`userID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `users_meta` ( +`userID` int(10) unsigned NOT NULL, +`metaKey` varchar(20) NOT NULL, +`metaValue` varchar(255) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `LUM_User` ( +`UserID` int(10) unsigned NOT NULL, +`RoleID` int(10) unsigned NOT NULL, +PRIMARY KEY (`UserID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `LUM_Role` ( +`RoleID` int(10) unsigned NOT NULL, +`Name` varchar(20) NOT NULL, +PRIMARY KEY (`RoleID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;