home / chat

event_txn_id_device_id

0 rows where event_id = 261

✎ View and edit SQL

This data as json

0 records

CREATE TABLE event_txn_id_device_id (
    event_id TEXT NOT NULL,
    room_id TEXT NOT NULL,
    user_id TEXT NOT NULL,
    device_id TEXT NOT NULL,
    txn_id TEXT NOT NULL,
    inserted_ts BIGINT NOT NULL,
    FOREIGN KEY (event_id)
        REFERENCES events (event_id) ON DELETE CASCADE,
    FOREIGN KEY (user_id, device_id)
        REFERENCES devices (user_id, device_id) ON DELETE CASCADE
);
CREATE UNIQUE INDEX event_txn_id_device_id_event_id
    ON event_txn_id_device_id(event_id);
CREATE INDEX event_txn_id_device_id_ts
    ON event_txn_id_device_id(inserted_ts);
CREATE UNIQUE INDEX event_txn_id_device_id_txn_id2 ON event_txn_id_device_id (user_id, device_id, room_id, txn_id) ;
Powered by Datasette · Queries took 10.245ms