summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
author3dB <3db@3decibels.net>2009-07-29 16:45:59 -0400
committer3dB <3db@3decibels.net>2009-07-29 16:45:59 -0400
commita04360aa66453809395a09a66ccd63e46a4cf519 (patch)
tree6be0c93ebc01a0e1a1ae432782d65d61ed1a90c5 /util
parentf713f21acfba72a9a5567592389fad8bcddbebc8 (diff)
Changed sessions.expiration column to timestamp
-- Updated SQL files to reflect column type change. -- Subroutine dbSessionAdd rewritten to accept an expiration timestap as an optional third argument.
Diffstat (limited to 'util')
-rw-r--r--util/dump.sql4
-rw-r--r--util/updates/update_2.6.sql6
2 files changed, 5 insertions, 5 deletions
diff --git a/util/dump.sql b/util/dump.sql
index e69947f6..e1a3aee4 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -165,7 +165,7 @@ CREATE TABLE screenshots (
CREATE TABLE sessions (
uid integer NOT NULL,
token character(40) NOT NULL,
- expiration bigint DEFAULT 0 NOT NULL,
+ expiration timestamp without time zone NOT NULL DEFAULT (now() + '1 year'::interval),
PRIMARY KEY (uid, token)
);
@@ -385,7 +385,7 @@ ALTER TABLE releases_vn ADD FOREIGN KEY (rid) REFERENCES releases_r
ALTER TABLE releases_vn ADD FOREIGN KEY (vid) REFERENCES vn (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE rlists ADD FOREIGN KEY (uid) REFERENCES users (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE rlists ADD FOREIGN KEY (rid) REFERENCES releases (id) DEFERRABLE INITIALLY DEFERRED;
-ALTER TABLE sessions ADD FOREIGN KEY (uid) REFERENCES users (id) DEFERRABLE INITIALLY DEFERRED;
+ALTER TABLE sessions ADD FOREIGN KEY (uid) REFERENCES users (id);
ALTER TABLE tags ADD FOREIGN KEY (addedby) REFERENCES users (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE tags_aliases ADD FOREIGN KEY (tag) REFERENCES tags (id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE tags_parents ADD FOREIGN KEY (tag) REFERENCES tags (id) DEFERRABLE INITIALLY DEFERRED;
diff --git a/util/updates/update_2.6.sql b/util/updates/update_2.6.sql
index e631039e..25b7782e 100644
--- a/util/updates/update_2.6.sql
+++ b/util/updates/update_2.6.sql
@@ -2,13 +2,13 @@
-- Create table for session data storage
CREATE TABLE sessions (
- uid integer NOT NULL REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED;
+ uid integer NOT NULL REFERENCES users(id);
token character(40) NOT NULL,
- expiration bigint DEFAULT 0 NOT NULL,
+ expiration timestamp without time zone DEFAULT (NOW() + '1 year'::interval) NOT NULL,
PRIMARY KEY (uid, token)
);
-- Add column to users for salt storage
-ALTER TABLE users ADD COLUMN salt character(9) NOT NULL DEFAULT '';
+ALTER TABLE users ADD COLUMN salt character(9) NOT NULL DEFAULT ''::bpchar;