dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

60.sql (664B)


      1 -- +migrate Up
      2 CREATE TABLE chat_room_whitelisted_users (
      3     room_id INTEGER NOT NULL,
      4     user_id INTEGER NOT NULL,
      5     created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
      6     PRIMARY KEY (room_id, user_id),
      7     CONSTRAINT chat_room_whitelisted_users_room_id_fk
      8         FOREIGN KEY (room_id)
      9             REFERENCES chat_rooms (id)
     10             ON DELETE CASCADE
     11             ON UPDATE CASCADE,
     12     CONSTRAINT chat_room_whitelisted_users_user_id_fk
     13         FOREIGN KEY (user_id)
     14             REFERENCES users (id)
     15             ON DELETE CASCADE
     16             ON UPDATE CASCADE);
     17 
     18 ALTER TABLE chat_rooms ADD COLUMN mode INTEGER NOT NULL DEFAULT 0;
     19 
     20 -- +migrate Down