13 lines
452 B
MySQL
Raw Normal View History

2022-05-30 15:13:27 -04:00
CREATE TABLE IF NOT EXISTS message (
2023-01-04 13:58:14 -04:00
id BYTEA,
receiverTimestamp BIGINT NOT NULL,
senderTimestamp BIGINT NOT NULL,
contentTopic BYTEA NOT NULL,
pubsubTopic BYTEA NOT NULL,
payload BYTEA,
2022-05-30 15:13:27 -04:00
version INTEGER NOT NULL DEFAULT 0,
CONSTRAINT messageIndex PRIMARY KEY (id, pubsubTopic)
2023-01-04 13:58:14 -04:00
);
2022-05-30 15:13:27 -04:00
CREATE INDEX IF NOT EXISTS message_senderTimestamp ON message(senderTimestamp);
CREATE INDEX IF NOT EXISTS message_receiverTimestamp ON message(receiverTimestamp);