added usertable for dockerfile

This commit is contained in:
Thies Mueller 2021-01-09 14:30:44 +01:00
parent bbbc4c71ed
commit bfaaf13064

17
fullinstalldocker.sql Normal file
View File

@ -0,0 +1,17 @@
CREATE DATABASE usertable;
CREATE USER 'usertable'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON usertable.* TO 'usertable'@'localhost';
USE usertable;
CREATE TABLE `users` (
`id` INT NOT NULL AUTO_INCREMENT ,
`email` VARCHAR(255) NOT NULL ,
`username` VARCHAR(255) NOT NULL ,
`password` VARCHAR(255) NOT NULL ,
`givenName` VARCHAR(255) NOT NULL DEFAULT '' ,
`lastName` VARCHAR(255) NOT NULL DEFAULT '' ,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`updated_at` TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`passwordcode` VARCHAR(255) NULL ,
`passwordcode_time` TIMESTAMP NULL ,
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;