From eea3bee850ba7877018a0ffe30aab757e6d587a6 Mon Sep 17 00:00:00 2001 From: Ludwig Weihmann <ludwig.weihmann@uni-potsdam.de> Date: Thu, 5 Jul 2018 10:04:08 +0200 Subject: [PATCH] feat: reset fltrail.sql script --- .../src/scripts/dbschema/fltrail.sql | 150 +++++++++--------- 1 file changed, 72 insertions(+), 78 deletions(-) diff --git a/gemeinsamforschen/src/scripts/dbschema/fltrail.sql b/gemeinsamforschen/src/scripts/dbschema/fltrail.sql index 2c363609..e4a12c8a 100644 --- a/gemeinsamforschen/src/scripts/dbschema/fltrail.sql +++ b/gemeinsamforschen/src/scripts/dbschema/fltrail.sql @@ -1,89 +1,83 @@ -CREATE DATABASE IF NOT EXISTS `fltrail` - DEFAULT CHARACTER SET utf8 - COLLATE utf8_general_ci; +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +CREATE DATABASE IF NOT EXISTS `fltrail` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `fltrail`; -CREATE TABLE if not exists `projects` ( - `id` varchar(400) NOT NULL, - `password` varchar(400) NOT NULL, - `active` tinyint(1) NOT NULL, - `timecreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP - ON UPDATE CURRENT_TIMESTAMP, - `author` varchar(400) NOT NULL, - `adminPassword` varchar(400) NOT NULL, - `token` varchar(400) NOT NULL -) - ENGINE = InnoDB - DEFAULT CHARSET = utf8; - - -CREATE TABLE if not exists `groups` ( - `id` int NOT NULL AUTO_INCREMENT, - `projectId` varchar(400) NOT NULL, - `chatRoomId` varchar(400) NOT NULL, - PRIMARY KEY (id) -) - ENGINE = InnoDB - DEFAULT CHARSET = utf8; - -CREATE TABLE if not exists groupuser -( - userEmail varchar(400) NOT NULL, - groupId int NOT NULL -) - ENGINE = InnoDB - DEFAULT CHARSET = utf8; +CREATE TABLE `projects` ( + `id` varchar(400) NOT NULL, + `password` varchar(400) NOT NULL, + `activ` tinyint(1) NOT NULL, + `timecreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `author` varchar(400) NOT NULL, + `adminpassword` varchar(400) NOT NULL, + `token` varchar(400) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE if not exists `tags` ( +CREATE TABLE `tags` ( `projectId` varchar(400) NOT NULL, - `tag` varchar(400) NOT NULL -) - ENGINE = InnoDB - DEFAULT CHARSET = utf8; - -CREATE TABLE if not exists `users` ( - `name` varchar(400) NOT NULL, - `password` varchar(200) NOT NULL, - `email` varchar(255) NOT NULL, - `token` varchar(800) NOT NULL, - `rocketChatId` varchar(400) NOT NULL, - `rocketChatAuthToken` varchar(800) NOT NULL, - UNIQUE (email) -) - ENGINE = InnoDB - DEFAULT CHARSET = utf8; - -CREATE TABLE if not exists projectuser + `tag` varchar(400) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `users` ( + `name` varchar(400) NOT NULL, + `password` varchar(200) NOT NULL, + `email` varchar(400) NOT NULL, + `token` varchar(800) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE projectuser ( projectId varchar(400) NOT NULL, - userId varchar(400) NOT NULL -) - ENGINE = InnoDB - DEFAULT CHARSET = utf8; - -CREATE TABLE `annotations` ( - `id` varchar(120) NOT NULL, - `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `userId` int(11) DEFAULT NULL, - `targetId` int(11) DEFAULT NULL, - `body` varchar(280) DEFAULT NULL, - `startCharacter` int(11) DEFAULT NULL, - `endCharacter` int(11) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + userId varchar(400) NOT NULL +); ENGINE=InnoDB DEFAULT CHARSET=utf8; alter table users add isStudent tinyint(1) default '1' null; -CREATE TABLE if not exists quiz -( - author varchar(400) NOT NULL, - projectId varchar(400) NOT NULL, - question varchar(400) NOT NULL, - mcType varchar(400) NOT NULL, - answer varchar(400) NOT NULL, - correct tinyint(1) NOT NULL -) - ENGINE = InnoDB - DEFAULT CHARSET = utf8; +CREATE TABLE researchReport ( + `id` varchar(400) NOT NULL, + `author` varchar(400) NOT NULL, + `title` varchar(400) NOT NULL, + `method` varchar(10000) NOT NULL, + `research` varchar(10000) NOT NULL, + `researchResult` varchar(10000) NOT NULL, + `evaluation` varchar(10000) NOT NULL, +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +//ToDo +CREATE TABLE timeplan( + `reportID` varchar(400) NOT NULL, + `startingTime` datetime NOT NULL, + `endTIme` datetime NOT NULL, + `milestoneTime` datetime NOT NULL, +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE researchQuestion( + `reportID` varchar(400) NOT NULL, + `question` varchar(4000) NOT NULL, +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE bibliography( + `reportID` varchar(400) NOT NULL, + `primarySource` varchar(4000) NOT NULL, + `secondarySource` varchar(4000) NOT NULL, +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE learningGoals( + `reportID` varchar(400) NOT NULL, + `goal` varchar(4000) NOT NULL, +)ENGINE=InnoDB DEFAULT CHARSET=utf8; + + + + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -- GitLab