Add notion of promo

This commit is contained in:
nemunaire 2021-03-01 17:47:00 +01:00
commit 000ac334cc
5 changed files with 40 additions and 20 deletions

2
db.go
View file

@ -60,6 +60,7 @@ CREATE TABLE IF NOT EXISTS users(
firstname VARCHAR(255) NOT NULL,
lastname VARCHAR(255) NOT NULL,
time TIMESTAMP NOT NULL,
promo MEDIUMINT NOT NULL,
is_admin BOOLEAN NOT NULL DEFAULT FALSE
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
`); err != nil {
@ -79,6 +80,7 @@ CREATE TABLE IF NOT EXISTS user_sessions(
CREATE TABLE IF NOT EXISTS surveys(
id_survey INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(255),
promo MEDIUMINT NOT NULL,
shown BOOLEAN NOT NULL DEFAULT FALSE,
corrected BOOLEAN NOT NULL DEFAULT FALSE,
start_availability TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,