path: root/util
diff options
authorYorhel <>2010-01-26 19:51:30 +0100
committerYorhel <>2010-01-26 19:51:30 +0100
commitf82550b1cef9e91780b43e61c60c61af1ba139fd (patch)
treeaa4d580db4e6558abb3e4a80a73aff529a64dd72 /util
parent38174567d7f68a2751426c0fadcda5eca1bd6861 (diff)
SQL: Replaced sessions.expiration with sessions.added
An expiration date doesn't make much sense if it's both not used and if it can't be configured by the user, so just make this a timestamp to indicate when the session has been added, which, while still not really used, is more valuable.
Diffstat (limited to 'util')
2 files changed, 4 insertions, 1 deletions
diff --git a/util/sql/schema.sql b/util/sql/schema.sql
index f0091929..557b75a1 100644
--- a/util/sql/schema.sql
+++ b/util/sql/schema.sql
@@ -172,7 +172,7 @@ CREATE TABLE screenshots (
CREATE TABLE sessions (
uid integer NOT NULL,
token bytea NOT NULL,
- expiration timestamptz NOT NULL DEFAULT (now() + '1 year'::interval),
+ added timestamptz NOT NULL DEFAULT NOW(),
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 09efd7d6..c59b2815 100644
--- a/util/updates/update_2.11.sql
+++ b/util/updates/update_2.11.sql
@@ -84,4 +84,7 @@ 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();
+ALTER TABLE sessions RENAME COLUMN expiration TO added;
+UPDATE sessions SET added = added - '1 year'::interval;