status-go/appdatabase/migrations/sql/1660134072_waku2_store_messages.up.sql
Richard Ramos ad326fa290
feat: wakuv2 store (#2780)
Allows runnning a store node depending on node config settings.
2022-08-19 12:34:07 -04:00

13 lines
497 B
SQL

CREATE TABLE IF NOT EXISTS store_messages (
id BLOB,
receiverTimestamp INTEGER NOT NULL,
senderTimestamp INTEGER NOT NULL,
contentTopic BLOB NOT NULL,
pubsubTopic BLOB NOT NULL,
payload BLOB,
version INTEGER NOT NULL DEFAULT 0,
CONSTRAINT messageIndex PRIMARY KEY (id, pubsubTopic)
) WITHOUT ROWID;
CREATE INDEX IF NOT EXISTS store_message_senderTimestamp ON store_messages(senderTimestamp);
CREATE INDEX IF NOT EXISTS store_message_receiverTimestamp ON store_messages(receiverTimestamp);