Use a different name for the sync AD table

This commit is contained in:
Brendan Abolivier 2017-07-31 15:12:17 +01:00
parent 57b97aef0c
commit d251e275f0
No known key found for this signature in database
GPG key ID: 8EF1500759F70623

View file

@ -22,7 +22,7 @@ import (
const accountDataSchema = ` const accountDataSchema = `
-- Stores the users account data -- 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 -- The highest numeric ID from the output_room_events at the time of saving the data
id BIGINT, id BIGINT,
-- ID of the user the data belongs to -- ID of the user the data belongs to
@ -40,12 +40,12 @@ CREATE TABLE IF NOT EXISTS account_data (
` `
const insertAccountDataSQL = "" + 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" + " ON CONFLICT ON CONSTRAINT account_data_unique" +
" DO UPDATE SET id = EXCLUDED.id" " DO UPDATE SET id = EXCLUDED.id"
const selectAccountDataInRangeSQL = "" + 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" + " WHERE user_id = $1 AND id > $2 AND id <= $3" +
" ORDER BY id ASC" " ORDER BY id ASC"