 CREATE TABLE topics (
   id         serial PRIMARY KEY,
   title      text NOT NULL,
-  user_id    int NOT NULL  REFERENCES users(id),
-  forum_id   int NOT NULL  REFERENCES forums(id),
+  user_id    int NOT NULL  REFERENCES users(id)  ON DELETE CASCADE,
+  forum_id   int NOT NULL  REFERENCES forums(id)  ON DELETE CASCADE,
   created_at timestamp with time zone NOT NULL  DEFAULT NOW(),
   is_roleplay boolean NOT NULL,
   -- Modkit flags


CREATE TABLE sessions (
  id         uuid PRIMARY KEY,
  user_id    int  REFERENCES users(id),
  ip_address inet NOT NULL,
  expired_at timestamp with time zone NOT NULL
                                      DEFAULT NOW() + INTERVAL '1 day',


CREATE TABLE forums (
  id              serial PRIMARY KEY,
  category_id     int NOT NULL  REFERENCES categories(id)  ON DELETE CASCADE,
  parent_forum_id int NULL  REFERENCES forums(id)  ON DELETE SET NULL,
  title           text NOT NULL,
  description     text NULL,
  pos             int NOT NULL,
