From 326a23aded279dedc8a4e6de64618f0fbee17bac Mon Sep 17 00:00:00 2001
From: Jesse Morgan <jesse@jesterpm.net>
Date: Thu, 13 Oct 2011 12:24:43 -0700
Subject: Changed the moderator schedule table to a view. Finished the
 exception iterator. Modified Post to only notify the next moderator. Need to
 add exception adding/removal.

---
 design/database.sql | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

(limited to 'design/database.sql')

diff --git a/design/database.sql b/design/database.sql
index 60b7006..b13fa39 100644
--- a/design/database.sql
+++ b/design/database.sql
@@ -94,12 +94,16 @@ CREATE TABLE page (
     UNIQUE  KEY(url)
 );
 
-CREATE TABLE moderator_schedule (
-    position    TINYINT UNSIGNED NOT NULL,
-    user_id     INTEGER UNSIGNED NOT NULL,
+-- CREATE TABLE moderator_schedule (
+--     position    TINYINT UNSIGNED NOT NULL,
+--     user_id     INTEGER UNSIGNED NOT NULL,
+-- 
+--     PRIMARY KEY(position, user_id)
+-- );
 
-    PRIMARY KEY(position, user_id)
-);
+CREATE VIEW moderator_schedule AS
+    SELECT id AS position, id AS user_id FROM user
+        WHERE notify=1;
 
 CREATE TABLE moderator_exceptions ( 
     year        INTEGER UNSIGNED NOT NULL,
-- 
cgit v1.2.3

