From d1e4d66126bdf500488d9014afdb5dbae23a1d6c Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 31 Aug 2020 17:35:23 +0300 Subject: [PATCH] make it launch --- syncapi/storage/sqlite3/peeks_table.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/syncapi/storage/sqlite3/peeks_table.go b/syncapi/storage/sqlite3/peeks_table.go index 9218e0e05..088f4007e 100644 --- a/syncapi/storage/sqlite3/peeks_table.go +++ b/syncapi/storage/sqlite3/peeks_table.go @@ -33,16 +33,16 @@ CREATE TABLE IF NOT EXISTS syncapi_peeks ( device_id TEXT NOT NULL, new BOOL NOT NULL DEFAULT true, -- When the peek was created in UNIX epoch ms. - creation_ts INTEGER NOT NULL, + creation_ts INTEGER NOT NULL ); CREATE INDEX IF NOT EXISTS syncapi_peeks_room_id_idx ON syncapi_peeks(room_id); -CREATE INDEX IF NOT EXISTS syncapi_peeks_user_id_device_id_idx ON syncapi_peeks(user_Id, device_id); +CREATE INDEX IF NOT EXISTS syncapi_peeks_user_id_device_id_idx ON syncapi_peeks(user_id, device_id); ` const insertPeekSQL = "" + "INSERT INTO syncapi_peeks" + - " (id, room_id, user_id, device_id, creation_ts" + + " (id, room_id, user_id, device_id, creation_ts)" + " VALUES ($1, $2, $3, $4, $5)" const deletePeekSQL = "" + @@ -68,7 +68,7 @@ type peekStatements struct { } func NewSqlitePeeksTable(db *sql.DB, streamID *streamIDStatements) (tables.Peeks, error) { - _, err := db.Exec(filterSchema) + _, err := db.Exec(peeksSchema) if err != nil { return nil, err }