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/mysql5.initial.sql | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'SQL/mysql5.initial.sql')

diff --git a/SQL/mysql5.initial.sql b/SQL/mysql5.initial.sql
index f9d647b80..e01f2a6b1 100644
--- a/SQL/mysql5.initial.sql
+++ b/SQL/mysql5.initial.sql
@@ -76,6 +76,10 @@ CREATE TABLE `cache` (
  INDEX `user_cache_index` (`user_id`,`cache_key`),
  CONSTRAINT `user_id_fk_cache` FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
+     ON DELETE CASCADE
+     ON UPDATE CASCADE,
+ CONSTRAINT `session_id_fk_cache` FOREIGN KEY (`session_id`)
+   REFERENCES `session`(`sess_id`)
      ON DELETE CASCADE
      ON UPDATE CASCADE
 ) TYPE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
-- 
cgit v1.2.3

