blob: cedf7a6cea9ead7d76d3885298b18c60fae6bfb1 [file] [log] [blame]
avm9996370995382020-09-23 01:03:01 +02001-- SQL sentences to set up all the DB tables
2
3CREATE TABLE users (
4 id INT NOT NULL AUTO_INCREMENT,
5 PRIMARY KEY(id),
6 sub VARCHAR(255) NOT NULL UNIQUE,
7 email VARCHAR(320)
8);
9
10CREATE TABLE subjects (
11 id INT NOT NULL AUTO_INCREMENT,
12 PRIMARY KEY(id),
13 friendly_name VARCHAR(100) NOT NULL UNIQUE, -- Nom que es mostra al web
14 calendar_name VARCHAR(100) NOT NULL -- Nom al calendari de la FME
15);
16
17CREATE TABLE user_subjects (
18 id INT NOT NULL AUTO_INCREMENT,
19 PRIMARY KEY(id),
20 user_id INT NOT NULL,
21 subject_id INT NOT NULL
22);
23
24-- @TODO: Add form completion log table