From c9fb0729f38f0d50e6f0a792e46190a2fb4205e0 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Sun, 4 Dec 2022 20:33:17 -0500 Subject: [PATCH] Bla --- auth/auth_sqlite.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/auth/auth_sqlite.go b/auth/auth_sqlite.go index 4ed89e3b..536d9e30 100644 --- a/auth/auth_sqlite.go +++ b/auth/auth_sqlite.go @@ -54,17 +54,15 @@ const ( PRIMARY KEY (user_id, base_url, topic) ); CREATE TABLE IF NOT EXISTS user_token ( - token TEXT NOT NULL, user_id INT NOT NULL, + token TEXT NOT NULL, expires INT NOT NULL, - PRIMARY KEY (token) + PRIMARY KEY (user_id, token) ); - CREATE INDEX idx_user_id ON user_token (user_id); CREATE TABLE IF NOT EXISTS schemaVersion ( id INT PRIMARY KEY, version INT NOT NULL ); - CREATE INDEX IF NOT EXISTS idx_user ON user_subscription (user); INSERT INTO plan (id, name) VALUES (1, 'Admin') ON CONFLICT (id) DO NOTHING; INSERT INTO user (id, user, pass, role) VALUES (1, '*', '', 'anonymous') ON CONFLICT (id) DO NOTHING; COMMIT;