diff options
Diffstat (limited to 'synapse/storage/schema/full_schemas/11/transactions.sql')
-rw-r--r-- | synapse/storage/schema/full_schemas/11/transactions.sql | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/storage/schema/full_schemas/11/transactions.sql b/synapse/storage/schema/full_schemas/11/transactions.sql index 0158308a38..cde6919e42 100644 --- a/synapse/storage/schema/full_schemas/11/transactions.sql +++ b/synapse/storage/schema/full_schemas/11/transactions.sql @@ -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; |