keep 'origin_server_ts' as 'ts' in the database to avoid needlessly updating schema

This commit is contained in:
Mark Haines 2014-10-17 17:31:48 +01:00
parent f5cf7ac25b
commit 82c5820767
8 changed files with 18 additions and 13 deletions

View file

@ -87,7 +87,8 @@ class TransactionStore(SQLBaseStore):
txn.execute(query, (code, response_json, transaction_id, origin))
def prep_send_transaction(self, transaction_id, destination, origin_server_ts, pdu_list):
def prep_send_transaction(self, transaction_id, destination,
origin_server_ts, pdu_list):
"""Persists an outgoing transaction and calculates the values for the
previous transaction id list.
@ -109,8 +110,8 @@ class TransactionStore(SQLBaseStore):
transaction_id, destination, origin_server_ts, pdu_list
)
def _prep_send_transaction(self, txn, transaction_id, destination, origin_server_ts,
pdu_list):
def _prep_send_transaction(self, txn, transaction_id, destination,
origin_server_ts, pdu_list):
# First we find out what the prev_txs should be.
# Since we know that we are only sending one transaction at a time,
@ -131,7 +132,7 @@ class TransactionStore(SQLBaseStore):
None,
transaction_id=transaction_id,
destination=destination,
origin_server_ts=origin_server_ts,
ts=origin_server_ts,
response_code=0,
response_json=None
))
@ -251,7 +252,7 @@ class ReceivedTransactionsTable(Table):
fields = [
"transaction_id",
"origin",
"origin_server_ts",
"ts",
"response_code",
"response_json",
"has_been_referenced",
@ -267,7 +268,7 @@ class SentTransactions(Table):
"id",
"transaction_id",
"destination",
"origin_server_ts",
"ts",
"response_code",
"response_json",
]