calendar-webapp/schema.sql

25 lines
670 B
MySQL
Raw Normal View History

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-20 21:51:38 +01:00
passwordHash CHAR(92) NOT NULL,
2017-11-09 02:24:15 +01:00
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',
2017-11-20 21:51:38 +01:00
'$5$eGohWUmw9yyiTqG7kti1MmT/jR52raEVlYuHQJa/sYk=$ucI+vTQq38Rr5RUAatd4Om0Dy9fuF0oKgkuVCuXSnxc=', 2);