summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-07-31 12:50:31 +0200
committerYorhel <git@yorhel.nl>2009-07-31 12:50:31 +0200
commitaf5293b8d33f4948ee5c9bcc2c4df38e611c88c6 (patch)
tree7f530f9df07bbfb893c74e406f127237b89b316b /util
parent5e9e6a78d3b7ffd177d91dba6602946dbd9a4c09 (diff)
Use bytea data type to store session tokens
To be consistent with users.passwd - hashes are stored in binary. All conversion from/to hex is done in the DB layer.
Diffstat (limited to 'util')
-rw-r--r--util/dump.sql2
-rw-r--r--util/updates/update_2.6.sql2
2 files changed, 2 insertions, 2 deletions
diff --git a/util/dump.sql b/util/dump.sql
index 2bb4fda5..ea5d7e68 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -164,7 +164,7 @@ CREATE TABLE screenshots (
-- sessions
CREATE TABLE sessions (
uid integer NOT NULL,
- token character(40) NOT NULL,
+ token bytea NOT NULL,
expiration timestamp NOT NULL DEFAULT (now() + '1 year'::interval),
PRIMARY KEY (uid, token)
);
diff --git a/util/updates/update_2.6.sql b/util/updates/update_2.6.sql
index 79fefd69..f0ddff65 100644
--- a/util/updates/update_2.6.sql
+++ b/util/updates/update_2.6.sql
@@ -3,7 +3,7 @@
-- Create table for session data storage
CREATE TABLE sessions (
uid integer NOT NULL REFERENCES users(id),
- token character(40) NOT NULL,
+ token bytea NOT NULL,
expiration timestamp NOT NULL DEFAULT (NOW() + '1 year'::interval),
PRIMARY KEY (uid, token)
);