avm99963 | 7099538 | 2020-09-23 01:03:01 +0200 | [diff] [blame^] | 1 | -- SQL sentences to set up all the DB tables |
| 2 | |
| 3 | CREATE 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 | |
| 10 | CREATE 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 | |
| 17 | CREATE 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 |