From 5e73fc02c767b818f4dde18774406f5ddf217093 Mon Sep 17 00:00:00 2001
From: 3dB <3db@3decibels.net>
Date: Tue, 28 Jul 2009 20:42:12 -0400
Subject: Multiple bugfixes to authorization system & sql tweaks

This commit is tested to work.
---
 util/dump.sql | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'util/dump.sql')

diff --git a/util/dump.sql b/util/dump.sql
index 22e80099..e69947f6 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 bigint DEFAULT 0 NOT NULL,
+    PRIMARY KEY (uid, token)
+);
+
 -- stats_cache
 CREATE TABLE stats_cache (
   section varchar(25) NOT NULL PRIMARY KEY,
@@ -256,7 +264,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
@@ -376,6 +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 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;
-- 
cgit v1.2.3

