From b1c0e57c8a1ccb9074cc5eecc64464aaece26973 Mon Sep 17 00:00:00 2001
From: M <m@lfurio.us>
Date: Thu, 19 Nov 2015 21:54:20 -0500
Subject: + Defined initial issue object in schema

---
 schema.sql | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

(limited to 'schema.sql')

diff --git a/schema.sql b/schema.sql
index 0867a75..2863cbc 100644
--- a/schema.sql
+++ b/schema.sql
@@ -46,7 +46,8 @@ CREATE TABLE `object` (
         'user',
         'group',
         'pad',
-        'stage'
+        'stage',
+        'issue'
     )                             NOT NULL,
     PRIMARY KEY (`guid`)
 );
@@ -76,6 +77,7 @@ DROP TABLE IF EXISTS `pad`;
 CREATE TABLE `pad` (
     `guid`   varchar(10)          NOT NULL,
     `stage`  varchar(10)      DEFAULT NULL,
+    `nextIssueNumber` int(10)     NOT NULL DEFAULT 0,
     PRIMARY KEY (`guid`)
 );
 
@@ -86,3 +88,16 @@ CREATE TABLE `stage` (
     `stage`  varchar(10)      DEFAULT NULL,
     PRIMARY KEY (`guid`)
 );
+
+/* Issue objects - special attributes */
+/* Notice: 'closed' issues should be denoted by being a child of the pad directly, and not the child of a pad's stages */
+/* Notice: an issue is 'unread' if the assignee has yet to review the issue.  Self assigned issues, by definition, cannot be in unread state. */
+DROP TABLE IF EXISTS `issue`;
+CREATE TABLE `issue` (
+    `guid`     varchar(10)        NOT NULL,
+    `number`   int(10) unsigned   NOT NULL,
+    `assignee` varchar(10)    DEFAULT NULL,
+    `unread`   int(10) unsigned   NOT NULL DEFAULT 1,
+    `desc`     text           DEFAULT NULL,
+    PRIMARY KEY (`guid`)
+);
-- 
cgit v1.2.3

