Rename insertion_event_id to just event_id

pull/10419/head
Eric Eastwood 2021-07-14 01:42:51 -05:00
parent f20ba0264c
commit 64aeb7330d
3 changed files with 11 additions and 11 deletions

View File

@ -951,10 +951,10 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
# Look for the "insertion" events connected to the given event_id # Look for the "insertion" events connected to the given event_id
# TODO: Do we need to worry about selecting only from the given room_id? The other query above doesn't # TODO: Do we need to worry about selecting only from the given room_id? The other query above doesn't
connected_insertion_event_query = ( connected_insertion_event_query = (
"SELECT e.depth, i.insertion_event_id FROM insertion_event_edges AS i" "SELECT e.depth, i.event_id FROM insertion_event_edges AS i"
# Get the depth of the insertion event from the events table # Get the depth of the insertion event from the events table
" INNER JOIN events AS e" " INNER JOIN events AS e"
" ON e.event_id = i.insertion_event_id" " ON e.event_id = i.event_id"
# Find an insertion event which points via prev_events to the given event_id # Find an insertion event which points via prev_events to the given event_id
" WHERE i.insertion_prev_event_id = ?" " WHERE i.insertion_prev_event_id = ?"
" LIMIT ?" " LIMIT ?"
@ -971,7 +971,7 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
" INNER JOIN events AS e" " INNER JOIN events AS e"
" ON e.event_id = c.event_id" " ON e.event_id = c.event_id"
# Find an insertion event which matches the given event_id # Find an insertion event which matches the given event_id
" WHERE i.insertion_event_id = ?" " WHERE i.event_id = ?"
" LIMIT ?" " LIMIT ?"
) )

View File

@ -1783,7 +1783,7 @@ class PersistEventsStore:
txn, txn,
table="insertion_events", table="insertion_events",
values={ values={
"insertion_event_id": event.event_id, "event_id": event.event_id,
"room_id": event.room_id, "room_id": event.room_id,
"next_chunk_id": next_chunk_id, "next_chunk_id": next_chunk_id,
}, },
@ -1795,7 +1795,7 @@ class PersistEventsStore:
txn, txn,
table="insertion_event_edges", table="insertion_event_edges",
values={ values={
"insertion_event_id": event.event_id, "event_id": event.event_id,
"room_id": event.room_id, "room_id": event.room_id,
"insertion_prev_event_id": prev_event_id, "insertion_prev_event_id": prev_event_id,
}, },

View File

@ -19,25 +19,25 @@
-- the "insertion" event and start navigating from there. -- the "insertion" event and start navigating from there.
CREATE TABLE IF NOT EXISTS insertion_events( CREATE TABLE IF NOT EXISTS insertion_events(
insertion_event_id TEXT NOT NULL, event_id TEXT NOT NULL,
room_id TEXT NOT NULL, room_id TEXT NOT NULL,
next_chunk_id TEXT NOT NULL, next_chunk_id TEXT NOT NULL,
UNIQUE (insertion_event_id, room_id, next_chunk_id) UNIQUE (event_id, room_id, next_chunk_id)
); );
CREATE INDEX IF NOT EXISTS insertion_events_insertion_room_id ON insertion_events(room_id); CREATE INDEX IF NOT EXISTS insertion_events_insertion_room_id ON insertion_events(room_id);
CREATE INDEX IF NOT EXISTS insertion_events_insertion_event_id ON insertion_events(insertion_event_id); CREATE INDEX IF NOT EXISTS insertion_events_event_id ON insertion_events(event_id);
CREATE INDEX IF NOT EXISTS insertion_events_next_chunk_id ON insertion_events(next_chunk_id); CREATE INDEX IF NOT EXISTS insertion_events_next_chunk_id ON insertion_events(next_chunk_id);
CREATE TABLE IF NOT EXISTS insertion_event_edges( CREATE TABLE IF NOT EXISTS insertion_event_edges(
insertion_event_id TEXT NOT NULL, event_id TEXT NOT NULL,
room_id TEXT NOT NULL, room_id TEXT NOT NULL,
insertion_prev_event_id TEXT NOT NULL, insertion_prev_event_id TEXT NOT NULL,
UNIQUE (insertion_event_id, room_id, insertion_prev_event_id) UNIQUE (event_id, room_id, insertion_prev_event_id)
); );
CREATE INDEX IF NOT EXISTS insertion_event_edges_insertion_room_id ON insertion_event_edges(room_id); CREATE INDEX IF NOT EXISTS insertion_event_edges_insertion_room_id ON insertion_event_edges(room_id);
CREATE INDEX IF NOT EXISTS insertion_event_edges_insertion_event_id ON insertion_event_edges(insertion_event_id); CREATE INDEX IF NOT EXISTS insertion_event_edges_event_id ON insertion_event_edges(event_id);
CREATE INDEX IF NOT EXISTS insertion_event_edges_insertion_prev_event_id ON insertion_event_edges(insertion_prev_event_id); CREATE INDEX IF NOT EXISTS insertion_event_edges_insertion_prev_event_id ON insertion_event_edges(insertion_prev_event_id);
CREATE TABLE IF NOT EXISTS chunk_edges( CREATE TABLE IF NOT EXISTS chunk_edges(