From d251e275f01d1fa2907d99e4c269bdc09f2a3087 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Mon, 31 Jul 2017 15:12:17 +0100 Subject: [PATCH] Use a different name for the sync AD table --- .../dendrite/syncapi/storage/account_data_table.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go b/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go index 0c1d9b658..c51cfd19a 100644 --- a/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go +++ b/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go @@ -22,7 +22,7 @@ import ( const accountDataSchema = ` -- Stores the users account data -CREATE TABLE IF NOT EXISTS account_data ( +CREATE TABLE IF NOT EXISTS account_data_type ( -- The highest numeric ID from the output_room_events at the time of saving the data id BIGINT, -- ID of the user the data belongs to @@ -40,12 +40,12 @@ CREATE TABLE IF NOT EXISTS account_data ( ` const insertAccountDataSQL = "" + - "INSERT INTO account_data (id, user_id, room_id, type) VALUES ($1, $2, $3, $4)" + + "INSERT INTO account_data_type (id, user_id, room_id, type) VALUES ($1, $2, $3, $4)" + " ON CONFLICT ON CONSTRAINT account_data_unique" + " DO UPDATE SET id = EXCLUDED.id" const selectAccountDataInRangeSQL = "" + - "SELECT room_id, type FROM account_data" + + "SELECT room_id, type FROM account_data_type" + " WHERE user_id = $1 AND id > $2 AND id <= $3" + " ORDER BY id ASC"