Commit 3435a0c3 authored by Frederik Wegner's avatar Frederik Wegner
Browse files

Fixes typos and missleading names in akamuschema functions

parent c6a25222
......@@ -21,7 +21,7 @@ USE `akamu` ;
DROP FUNCTION IF EXISTS isAnswered;
-- returns 1 if the user answered all questions of the round
-- a round is hardcoded to have 2 questions
DELIMITER //
CREATE FUNCTION IF NOT EXISTS isAnswered
(userid INT UNSIGNED, roundid INT UNSIGNED)
......@@ -36,7 +36,7 @@ BEGIN
END//
DELIMITER ;
DROP FUNCTION IF EXISTS isAnsweredDuelCurrectRound;
DROP FUNCTION IF EXISTS isAnsweredDuelCurrentRound;
DELIMITER //
CREATE FUNCTION IF NOT EXISTS isAnsweredDuelCurrentRound
(userid INT UNSIGNED, duelid INT UNSIGNED)
......@@ -51,9 +51,9 @@ BEGIN
END//
DELIMITER ;
DROP FUNCTION IF EXISTS getNotStartedDuel;
DROP FUNCTION IF EXISTS getNotStarted;
DELIMITER //
CREATE FUNCTION IF NOT EXISTS getNotStartedDuel
CREATE FUNCTION IF NOT EXISTS getNotStarted
(duelid INT UNSIGNED)
RETURNS INT UNSIGNED NOT DETERMINISTIC
BEGIN
......@@ -296,7 +296,7 @@ CREATE TABLE IF NOT EXISTS `akamu`.`user` (
`email` VARCHAR(45) NULL,
`semester` INT UNSIGNED NULL,
`experience` INT NOT NULL,
`level` AS FLOOR(SQRT(`experience`)/3) PERSISTED,
`level` INT GENERATED ALWAYS AS (FLOOR(SQRT(`experience`)/3)) STORED,
`selected_avatar` INT UNSIGNED NULL,
`selected_title` INT UNSIGNED NULL DEFAULT 0,
`verified` TINYINT UNSIGNED NOT NULL DEFAULT 0,
......@@ -658,7 +658,9 @@ CREATE TABLE IF NOT EXISTS `akamu`.`trainingsubscription` (
(`pool`)
REFERENCES `akamu`.`pool` (`idpool`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `idx_duel_number` UNIQUE INDEX
(`duel`, `number`)
)
ENGINE = InnoDB;
......
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