summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-07-16 21:37:14 +0000
committeruckelman <uckelman@nomic.net>2010-07-16 21:37:14 +0000
commit222ef63558938c27c38b302bfb6a4f71bcd4c1b0 (patch)
treed96e3180c89d1de7587145e44fb51af1067ed037
parent8bf43475d437e8fa41bcade5cba830b13f809c7f (diff)
Added lists table for mapping forum ids to lists.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6993 67b53d14-2c14-4ace-a08f-0dab2b34000c
-rw-r--r--src/Bridge.php3
-rw-r--r--src/schema.sql9
2 files changed, 8 insertions, 4 deletions
diff --git a/src/Bridge.php b/src/Bridge.php
index b137b51..3b3ed51 100644
--- a/src/Bridge.php
+++ b/src/Bridge.php
@@ -65,7 +65,7 @@ class Bridge {
public function getLists($forumId) {
throw_if_null($forumId);
- $sql = 'SELECT list_name FROM forums ' .
+ $sql = 'SELECT list_name FROM lists ' .
'WHERE forum_id = ' . $forumId;
$result = $this->db->query($sql);
@@ -133,6 +133,7 @@ class Bridge {
$count = $this->db->exec($sql);
+# FIXME: throwing an exception prevents us from deleting old posts
if ($count < 1) {
throw new Exception('Failed to delete post id: ' . $postId);
}
diff --git a/src/schema.sql b/src/schema.sql
index 92fba4b..0a89f75 100644
--- a/src/schema.sql
+++ b/src/schema.sql
@@ -1,4 +1,3 @@
-
CREATE TABLE posts (
post_id MEDIUMINT UNSIGNED,
message_id VARCHAR(255) NOT NULL,
@@ -12,7 +11,11 @@ CREATE TABLE posts (
CREATE TABLE forums (
list_name VARCHAR(255) NOT NULL,
forum_id MEDIUMINT UNSIGNED NOT NULL,
- PRIMARY KEY (list_name),
- INDEX (forum_id)
+ PRIMARY KEY (list_name)
);
+CREATE TABLE lists (
+ list_name VARCHAR(255) NOT NULL,
+ forum_id MEDIUMINT UNSIGNED NOT NULL,
+ PRIMARY KEY (forum_id)
+);