mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-14 23:00:42 -05:00
Fix up schemas to work with mariadb
This commit is contained in:
parent
89036579ed
commit
fae059cc18
15 changed files with 82 additions and 84 deletions
|
|
@ -16,12 +16,12 @@
|
|||
CREATE TABLE IF NOT EXISTS received_transactions(
|
||||
transaction_id VARCHAR(255),
|
||||
origin VARCHAR(255),
|
||||
ts INTEGER,
|
||||
ts BIGINT,
|
||||
response_code INTEGER,
|
||||
response_json BLOB,
|
||||
has_been_referenced BOOL default 0, -- Whether thishas been referenced by a prev_tx
|
||||
UNIQUE (transaction_id, origin)
|
||||
);
|
||||
) ENGINE = INNODB;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS transactions_have_ref ON received_transactions(origin, has_been_referenced);-- WHERE has_been_referenced = 0;
|
||||
|
||||
|
|
@ -29,13 +29,13 @@ CREATE INDEX IF NOT EXISTS transactions_have_ref ON received_transactions(origin
|
|||
-- Stores what transactions we've sent, what their response was (if we got one) and whether we have
|
||||
-- since referenced the transaction in another outgoing transaction
|
||||
CREATE TABLE IF NOT EXISTS sent_transactions(
|
||||
id INTEGER PRIMARY KEY, -- This is used to apply insertion ordering
|
||||
id BIGINT PRIMARY KEY, -- This is used to apply insertion ordering
|
||||
transaction_id VARCHAR(255),
|
||||
destination VARCHAR(255),
|
||||
response_code INTEGER DEFAULT 0,
|
||||
response_json BLOB,
|
||||
ts INTEGER
|
||||
);
|
||||
) ENGINE = INNODB;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS sent_transaction_dest ON sent_transactions(destination);
|
||||
CREATE INDEX IF NOT EXISTS sent_transaction_dest_referenced ON sent_transactions(destination);
|
||||
|
|
@ -52,13 +52,13 @@ CREATE TABLE IF NOT EXISTS transaction_id_to_pdu(
|
|||
pdu_id VARCHAR(255),
|
||||
pdu_origin VARCHAR(255),
|
||||
UNIQUE (transaction_id, destination)
|
||||
);
|
||||
) ENGINE = INNODB;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS transaction_id_to_pdu_dest ON transaction_id_to_pdu(destination);
|
||||
|
||||
-- To track destination health
|
||||
CREATE TABLE IF NOT EXISTS destinations(
|
||||
destination VARCHAR(255) PRIMARY KEY,
|
||||
retry_last_ts INTEGER,
|
||||
retry_last_ts BIGINT,
|
||||
retry_interval INTEGER
|
||||
);
|
||||
) ENGINE = INNODB;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue