dkforest

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

68.sql (598B)


      1 -- +migrate Up
      2 CREATE TABLE IF NOT EXISTS user_room_subscriptions (
      3     user_id INTEGER NOT NULL,
      4     room_id INTEGER NOT NULL,
      5     created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
      6     PRIMARY KEY (user_id, room_id),
      7     CONSTRAINT user_room_subscriptions_user_id_fk
      8         FOREIGN KEY (user_id)
      9             REFERENCES users (id)
     10             ON DELETE CASCADE
     11             ON UPDATE CASCADE,
     12     CONSTRAINT user_room_subscriptions_room_id_fk
     13         FOREIGN KEY (room_id)
     14             REFERENCES chat_rooms (id)
     15             ON DELETE CASCADE
     16             ON UPDATE CASCADE);
     17 
     18 -- +migrate Down