text: DROP TABLE IF EXISTS meta;
  
  CREATE TABLE meta (
  	key TEXT UNIQUE PRIMARY KEY,
  	value TEXT
  );
  
  INSERT INTO meta (key, value) VALUES ("version", "001");
  
  DROP TABLE IF EXISTS syndicate;
  
  CREATE TABLE syndicate (
  	id INTEGER PRIMARY KEY,
  	owner TEXT UNIQUE NOT NULL,
  	year INTEGER NOT NULL
  );
  
  DROP TABLE IF EXISTS user;
  
  CREATE TABLE user (
  	crsid TEXT UNIQUE PRIMARY KEY,
  	forename TEXT,
  	surname TEXT NOT NULL,
  	year INTEGER NOT NULL,
  	syndicate INTEGER DEFAULT NULL,
  	formtoken TEXT NOT NULL,
  	has_filled INTEGER NOT NULL DEFAULT 0
  );
  
  DROP TABLE IF EXISTS syndicate_invitation;
  
  CREATE TABLE syndicate_invitation (
  	id INTEGER PRIMARY KEY,
  	syndicate INTEGER NOT NULL,
  	recipient TEXT NOT NULL,
  	used INTEGER DEFAULT 0
  );
  
  DROP TABLE IF EXISTS log_message;
  
  CREATE TABLE log_message (
  	id INTEGER PRIMARY KEY,
  	user TEXT NOT NULL,
  	time INTEGER NOT NULL,
  	message TEXT NOT NULL
  );
  
  DROP TABLE IF EXISTS mail_queue;
  
  CREATE TABLE mail_queue (
  	id INTEGER PRIMARY KEY,
  	recipient TEXT NOT NULL,
  	subject TEXT NOT NULL,
  	body TEXT NOT NULL
  );
  
  DROP TABLE IF EXISTS form_payload;
  
  CREATE TABLE form_payload (
  	id INTEGER PRIMARY KEY,
  	time INTEGER NOT NULL,
  	json TEXT NOT NULL
  );
  
  DROP TABLE IF EXISTS room;
  
  CREATE TABLE room (
  	id INTEGER PRIMARY KEY,
  	shortname TEXT UNIQUE NOT NULL,
  	inhabitant TEXT DEFAULT NULL
  );
  
  DROP TABLE IF EXISTS review;
  
  CREATE TABLE review (
  	id INTEGER PRIMARY KEY,
  	author TEXT NOT NULL,
  	room INTEGER NOT NULL,
  	layout_rating INTEGER NOT NULL,
  	facilities_rating INTEGER NOT NULL,
  	noise_rating INTEGER NOT NULL,
  	overall_rating INTEGER NOT NULL,
  	title TEXT NOT NULL,
  	body TEXT NOT NULL
  );
  