diff options
author | Yorhel <git@yorhel.nl> | 2009-07-30 09:43:37 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-07-30 09:45:00 +0200 |
commit | 4e1a84ae9ee6dbc5ea18517a9112ae1821797eb7 (patch) | |
tree | 2a13682473e2e7dc9a1bb59fe0e32f1f294b77dd /util | |
parent | d6a9d1c5d613c13cf9de4ecf254ba864341975be (diff) | |
parent | a04360aa66453809395a09a66ccd63e46a4cf519 (diff) |
Merge branch 'auth' of git://3decibels.net/vndb into beta
Conflicts:
util/dump.sql
util/updates/update_2.6.sql
Also updated ChangeLog and made some tiny style changes.
Diffstat (limited to 'util')
-rw-r--r-- | util/dump.sql | 12 | ||||
-rw-r--r-- | util/updates/update_2.6.sql | 13 |
2 files changed, 24 insertions, 1 deletions
diff --git a/util/dump.sql b/util/dump.sql index 84cbecbc..f7f9bb9e 100644 --- a/util/dump.sql +++ b/util/dump.sql @@ -161,6 +161,14 @@ CREATE TABLE screenshots ( height smallint NOT NULL DEFAULT 0 ); +-- sessions +CREATE TABLE sessions ( + uid integer NOT NULL, + token character(40) NOT NULL, + expiration timestamp NOT NULL DEFAULT (now() + '1 year'::interval), + PRIMARY KEY (uid, token) +); + -- stats_cache CREATE TABLE stats_cache ( section varchar(25) NOT NULL PRIMARY KEY, @@ -255,7 +263,8 @@ CREATE TABLE users ( skin varchar(128) NOT NULL DEFAULT '', customcss text NOT NULL DEFAULT '', ip inet NOT NULL DEFAULT '0.0.0.0', - c_tags integer NOT NULL DEFAULT 0 + c_tags integer NOT NULL DEFAULT 0, + salt character(9) NOT NULL DEFAULT '' ); -- vn @@ -365,6 +374,7 @@ ALTER TABLE releases_vn ADD FOREIGN KEY (rid) REFERENCES releases_r ALTER TABLE releases_vn ADD FOREIGN KEY (vid) REFERENCES vn (id); ALTER TABLE rlists ADD FOREIGN KEY (uid) REFERENCES users (id); ALTER TABLE rlists ADD FOREIGN KEY (rid) REFERENCES releases (id); +ALTER TABLE sessions ADD FOREIGN KEY (uid) REFERENCES users (id); ALTER TABLE tags ADD FOREIGN KEY (addedby) REFERENCES users (id); ALTER TABLE tags_aliases ADD FOREIGN KEY (tag) REFERENCES tags (id); ALTER TABLE tags_parents ADD FOREIGN KEY (tag) REFERENCES tags (id); diff --git a/util/updates/update_2.6.sql b/util/updates/update_2.6.sql index 567af268..67bbe584 100644 --- a/util/updates/update_2.6.sql +++ b/util/updates/update_2.6.sql @@ -1,5 +1,18 @@ +-- Create table for session data storage +CREATE TABLE sessions ( + uid integer NOT NULL REFERENCES users(id); + token character(40) NOT NULL, + expiration NOT NULL DEFAULT (NOW() + '1 year'::interval), + PRIMARY KEY (uid, token) +); + +-- Add column to users for salt storage +ALTER TABLE users ADD COLUMN salt character(9) NOT NULL DEFAULT ''::bpchar; + + + -- The anime table: -- - use timestamp data type for anime.lastfetch -- - allow NULL for all columns except id |