Align db setup to dumped values

This commit is contained in:
Marcel Schwarz 2020-03-14 19:50:49 +01:00
parent a0c8944d09
commit 6572f20b93

View File

@ -2,20 +2,22 @@ CREATE DATABASE friendsbook;
USE friendsbook;
CREATE TABLE `tans` (
`id` INT NOT NULL AUTO_INCREMENT,
`tan` VARCHAR(13) NOT NULL,
`used` BOOLEAN NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
CREATE TABLE `user` (
`ID` INT NOT NULL AUTO_INCREMENT,
`user` VARCHAR(50) NOT NULL DEFAULT '0',
`username` VARCHAR(50) NOT NULL DEFAULT '0',
`email` VARCHAR(100) NOT NULL DEFAULT '0',
`password` VARCHAR(100) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
UNIQUE INDEX `user` (`user`)
UNIQUE INDEX `user`(`username`)
) ENGINE = InnoDB;
CREATE TABLE `tans` (
`id` INT NOT NULL AUTO_INCREMENT,
`userID` INT NOT NULL,
`tan` VARCHAR(13) NOT NULL,
`used` BOOLEAN NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`userID`) REFERENCES `user`(`ID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB;
CREATE TABLE `entries` (