ForumExperiment/migrations/001-initial-schema.sql

32 lines
575 B
MySQL
Raw Normal View History

2023-04-13 19:21:17 +00:00
-- Up
CREATE TABLE Thread(
id INTEGER PRIMARY KEY,
author INTEGER NOT NULL,
name STRING NOT NULL,
creationdate INTEGER,
description STRING
);
CREATE TABLE Message (
id INTEGER PRIMARY KEY,
text STRING NOT NULL,
subject STRING,
creationdate INTEGER NOT NULL,
thread INTEGER NOT NULL,
author INTEGER NOT NULL
);
CREATE TABLE User (
id INTEGER PRIMARY KEY,
username STRING UNIQUE NOT NULL,
password STRING NOT NULL,
creationdate INTEGER NOT NULL
);
-- Down
DROP TABLE Message;
DROP TABLE User;
DROP TABLE Thread;