Commit d0d3d04c authored by Frederik Wegner's avatar Frederik Wegner
Browse files

Merge branch 'development' of akamu.gitlab:akamu/data-schemas into development

parents 3435a0c3 941bad64
......@@ -290,13 +290,13 @@ CREATE TABLE IF NOT EXISTS `akamu`.`title` (
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `akamu`.`user` (
`iduser` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`time_registered` DATETIME NOT NULL,
`time_registered` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`username` VARCHAR(45) NOT NULL,
`password` VARCHAR(64) NOT NULL,
`email` VARCHAR(45) NULL,
`semester` INT UNSIGNED NULL,
`experience` INT NOT NULL,
`level` INT GENERATED ALWAYS AS (FLOOR(SQRT(`experience`)/3)) STORED,
`level` INT UNSIGNED AS (FLOOR(SQRT(`experience`)/3)) PERSISTENT,
`selected_avatar` INT UNSIGNED NULL,
`selected_title` INT UNSIGNED NULL DEFAULT 0,
`verified` TINYINT UNSIGNED NOT NULL DEFAULT 0,
......@@ -473,8 +473,8 @@ CREATE TABLE IF NOT EXISTS `akamu`.`flashcard` (
`idflashcard` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`author` INT UNSIGNED NULL,
`subject` INT UNSIGNED NULL,
`creationdate` DATETIME NOT NULL,
`lastmodified`DATETIME NOT NULL,
`creationdate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`lastmodified`DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`fronttext` VARCHAR(1023) NOT NULL,
`backtext` VARCHAR(1023) NOT NULL,
`frontimage` INT UNSIGNED NULL,
......@@ -510,7 +510,7 @@ CREATE TABLE IF NOT EXISTS `akamu`.`flashcard` (
CREATE TABLE IF NOT EXISTS `akamu`.`cardsubscription` (
`flashcard` INT UNSIGNED NOT NULL,
`user` INT UNSIGNED NOT NULL,
`since` DATETIME NOT NULL,
`since` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`flashcard`,`user`),
INDEX `fk_flashcard_UNIQUE` (`flashcard` ASC, `user` ASC),
INDEX `fk_user_UNIQUE` (`user` ASC, `flashcard` ASC),
......@@ -532,8 +532,8 @@ CREATE TABLE IF NOT EXISTS `akamu`.`cardsubscription` (
CREATE TABLE IF NOT EXISTS `akamu`.`traininglist` (
`author` INT UNSIGNED NOT NULL,
`subject` INT UNSIGNED NOT NULL,
`creationdate` DATETIME NOT NULL,
`lastmodified`DATETIME NOT NULL,
`creationdate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`lastmodified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`author`,`subject`),
INDEX `author_UNIQUE` (`author` ASC, `subject` ASC),
INDEX `subject_UNIQUE` (`subject` ASC, `author` ASC),
......@@ -556,7 +556,7 @@ CREATE TABLE IF NOT EXISTS `akamu`.`trainingsubscription` (
`author` INT UNSIGNED NOT NULL,
`subject` INT UNSIGNED NOT NULL,
`user` INT UNSIGNED NOT NULL,
`since` DATETIME NOT NULL,
`since` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`author`,`subject`,`user`),
INDEX `fk_author_UNIQUE` (`author` ASC, `subject` ASC),
INDEX `fk_subject_UNIQUE` (`subject` ASC, `author` ASC),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment