2017-10-30 02:31:48 +01:00
|
|
|
CREATE DATABASE CalendarWebapp;
|
|
|
|
USE CalendarWebapp;
|
|
|
|
|
|
|
|
CREATE TABLE users (
|
|
|
|
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
username CHAR(30) NOT NULL UNIQUE,
|
2017-11-09 02:24:15 +01:00
|
|
|
passwordHash CHAR(60) NOT NULL,
|
|
|
|
privilege TINYINT UNSIGNED NOT NULL,
|
2017-10-30 02:31:48 +01:00
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE events (
|
|
|
|
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
begin DATE NOT NULL,
|
|
|
|
end DATE,
|
|
|
|
name CHAR(128) NOT NULL,
|
|
|
|
description TEXT NOT NULL,
|
|
|
|
type TINYINT UNSIGNED NOT NULL,
|
|
|
|
shout BOOLEAN NOT NULL,
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
2017-11-09 02:24:15 +01:00
|
|
|
INSERT INTO users (username, passwordHash, privilege) VALUES ('foo',
|
|
|
|
'$2a$10$9LBqOZV99ARiE4Nx.2b7GeYfqk2.0A32PWGu2cRGyW2hRJ0xeDfnO', 2);
|