SPEC-7: Rename 'ts' to 'origin_server_ts'

This commit is contained in:
Mark Haines 2014-10-17 17:12:25 +01:00
parent 456017e0ae
commit f5cf7ac25b
16 changed files with 42 additions and 42 deletions

View file

@ -361,7 +361,7 @@ class SQLBaseStore(object):
if "age_ts" not in d:
# For compatibility
d["age_ts"] = d["ts"] if "ts" in d else 0
d["age_ts"] = d["origin_server_ts"] if "origin_server_ts" in d else 0
return self.event_factory.create_event(
etype=d["type"],

View file

@ -789,7 +789,7 @@ class PdusTable(Table):
"origin",
"context",
"pdu_type",
"ts",
"origin_server_ts",
"depth",
"is_state",
"content_json",

View file

@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS pdus(
origin TEXT,
context TEXT,
pdu_type TEXT,
ts INTEGER,
origin_server_ts INTEGER,
depth INTEGER DEFAULT 0 NOT NULL,
is_state BOOL,
content_json TEXT,

View file

@ -16,7 +16,7 @@
CREATE TABLE IF NOT EXISTS received_transactions(
transaction_id TEXT,
origin TEXT,
ts INTEGER,
origin_server_ts INTEGER,
response_code INTEGER,
response_json TEXT,
has_been_referenced BOOL default 0, -- Whether thishas been referenced by a prev_tx
@ -35,7 +35,7 @@ CREATE TABLE IF NOT EXISTS sent_transactions(
destination TEXT,
response_code INTEGER DEFAULT 0,
response_json TEXT,
ts INTEGER
origin_server_ts INTEGER
);
CREATE INDEX IF NOT EXISTS sent_transaction_dest ON sent_transactions(destination);

View file

@ -87,7 +87,7 @@ class TransactionStore(SQLBaseStore):
txn.execute(query, (code, response_json, transaction_id, origin))
def prep_send_transaction(self, transaction_id, destination, 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.
@ -97,7 +97,7 @@ class TransactionStore(SQLBaseStore):
Args:
transaction_id (str)
destination (str)
ts (int)
origin_server_ts (int)
pdu_list (list)
Returns:
@ -106,10 +106,10 @@ class TransactionStore(SQLBaseStore):
return self.runInteraction(
self._prep_send_transaction,
transaction_id, destination, ts, pdu_list
transaction_id, destination, origin_server_ts, pdu_list
)
def _prep_send_transaction(self, txn, transaction_id, destination, ts,
def _prep_send_transaction(self, txn, transaction_id, destination, origin_server_ts,
pdu_list):
# First we find out what the prev_txs should be.
@ -131,7 +131,7 @@ class TransactionStore(SQLBaseStore):
None,
transaction_id=transaction_id,
destination=destination,
ts=ts,
origin_server_ts=origin_server_ts,
response_code=0,
response_json=None
))
@ -251,7 +251,7 @@ class ReceivedTransactionsTable(Table):
fields = [
"transaction_id",
"origin",
"ts",
"origin_server_ts",
"response_code",
"response_json",
"has_been_referenced",
@ -267,7 +267,7 @@ class SentTransactions(Table):
"id",
"transaction_id",
"destination",
"ts",
"origin_server_ts",
"response_code",
"response_json",
]