summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/sql/schema.sql1
-rw-r--r--util/updates/update_2.11.sql4
2 files changed, 5 insertions, 0 deletions
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index f345cffd..f0091929 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -173,6 +173,7 @@ CREATE TABLE sessions (
uid integer NOT NULL,
token bytea NOT NULL,
expiration timestamptz NOT NULL DEFAULT (now() + '1 year'::interval),
+ lastused timestamptz NOT NULL DEFAULT NOW(),
PRIMARY KEY (uid, token)
);
diff --git a/util/updates/update_2.11.sql b/util/updates/update_2.11.sql
index bf999cdc..09efd7d6 100644
--- a/util/updates/update_2.11.sql
+++ b/util/updates/update_2.11.sql
@@ -81,3 +81,7 @@ UNION SELECT 'r', COUNT(*) FROM (SELECT tmp_edit_hidlock('r', id) FROM releases
UNION SELECT 'p', COUNT(*) FROM (SELECT tmp_edit_hidlock('p', id) FROM producers WHERE hidden OR locked) x;
DROP FUNCTION tmp_edit_hidlock(text, integer);
+
+-- keep track of when a session is last used
+ALTER TABLE sessions ADD COLUMN lastused timestamptz NOT NULL DEFAULT NOW();
+