From bfaaf13064484664b0c522d8c187d4df527367c0 Mon Sep 17 00:00:00 2001 From: Thies Mueller Date: Sat, 9 Jan 2021 14:30:44 +0100 Subject: [PATCH] added usertable for dockerfile --- fullinstalldocker.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fullinstalldocker.sql diff --git a/fullinstalldocker.sql b/fullinstalldocker.sql new file mode 100644 index 0000000..082892b --- /dev/null +++ b/fullinstalldocker.sql @@ -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;