From be7d3b6918ff90757d10804ac914edb5a65f4828 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 21 Nov 2008 14:33:58 +0000
Subject: - Fix 'cache' table cleanup on session destroy (#1485516)

---
 SQL/postgres.update.sql | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'SQL/postgres.update.sql')

diff --git a/SQL/postgres.update.sql b/SQL/postgres.update.sql
index dfc282b4a..fdd7f0f5e 100644
--- a/SQL/postgres.update.sql
+++ b/SQL/postgres.update.sql
@@ -21,3 +21,9 @@ ALTER TABLE cache ADD FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE
 -- Updates from version 0.2-alpha
 
 CREATE INDEX messages_created_idx ON messages (created);
+
+-- Updates from version 0.2-beta
+
+ALTER TABLE cache DROP CONSTRAINT cache_session_id_fkey;
+ALTER TABLE cache ADD FOREIGN KEY (session_id) REFERENCES session(sess_id) ON DELETE CASCADE ON UPDATE CASCADE;
+CREATE INDEX cache_session_id_idx ON "cache" (session_id);
-- 
cgit v1.2.3

