Make SQLite work

This commit is contained in:
Till Faelligen 2024-03-15 22:48:19 +01:00
parent 5567da100c
commit fe75cb77d3
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E
2 changed files with 4 additions and 8 deletions

View file

@ -2359,9 +2359,6 @@ func TestReportEvent(t *testing.T) {
eventToReport := room.CreateAndInsert(t, alice, "m.room.message", map[string]interface{}{"body": "hello world"}) eventToReport := room.CreateAndInsert(t, alice, "m.room.message", map[string]interface{}{"body": "hello world"})
test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) { test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) {
if dbType == test.DBTypeSQLite {
t.Skip()
}
cfg, processCtx, close := testrig.CreateConfig(t, dbType) cfg, processCtx, close := testrig.CreateConfig(t, dbType)
routers := httputil.NewRouters() routers := httputil.NewRouters()
cm := sqlutil.NewConnectionManager(processCtx, cfg.Global.DatabaseOptions) cm := sqlutil.NewConnectionManager(processCtx, cfg.Global.DatabaseOptions)

View file

@ -26,16 +26,15 @@ import (
) )
const reportedEventsScheme = ` const reportedEventsScheme = `
CREATE SEQUENCE IF NOT EXISTS roomserver_reported_events_id_seq;
CREATE TABLE IF NOT EXISTS roomserver_reported_events CREATE TABLE IF NOT EXISTS roomserver_reported_events
( (
id BIGINT PRIMARY KEY DEFAULT nextval('roomserver_reported_events_id_seq'), id INTEGER PRIMARY KEY AUTOINCREMENT,
room_nid BIGINT NOT NULL, room_nid INTEGER NOT NULL,
event_nid BIGINT NOT NULL, event_nid INTEGER NOT NULL,
user_id TEXT NOT NULL, user_id TEXT NOT NULL,
reason TEXT, reason TEXT,
score INTEGER, score INTEGER,
received_ts BIGINT NOT NULL received_ts INTEGER NOT NULL
);` );`
const insertReportedEventSQL = ` const insertReportedEventSQL = `