From 1817ca717b6e3daac3328b65da93a8fdfd205b75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20St=C3=A4hr?= <software@mstaehr.net>
Date: Sat, 16 Jun 2018 23:01:24 +0200
Subject: [PATCH] fix: add UNIQUE for email

email have to be unique, because it identifies a user
---
 gemeinsamforschen/src/scripts/dbschema/fltrail.sql | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gemeinsamforschen/src/scripts/dbschema/fltrail.sql b/gemeinsamforschen/src/scripts/dbschema/fltrail.sql
index 372f245e..11c65982 100644
--- a/gemeinsamforschen/src/scripts/dbschema/fltrail.sql
+++ b/gemeinsamforschen/src/scripts/dbschema/fltrail.sql
@@ -32,10 +32,11 @@ CREATE TABLE if not exists `tags` (
 CREATE TABLE if not exists `users` (
   `name`                varchar(400) NOT NULL,
   `password`            varchar(200) NOT NULL,
-  `email`               varchar(400) NOT NULL,
+  `email`               varchar(255) NOT NULL,
   `token`               varchar(800) NOT NULL,
   `rocketChatId`        varchar(400) NOT NULL,
-  `rocketChatAuthToken` varchar(800) NOT NULL
+  `rocketChatAuthToken` varchar(800) NOT NULL,
+  UNIQUE (email)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE if not exists projectuser
-- 
GitLab