From 9df5344050ec0a2b8bec03c7a89fff9d7d41ce2f Mon Sep 17 00:00:00 2001
From: Malf Furious <m@lfurio.us>
Date: Sat, 20 Oct 2018 21:24:01 -0400
Subject: issue:  Add author and authored fields

---
 srvs/mysql.sql | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'srvs/mysql.sql')

diff --git a/srvs/mysql.sql b/srvs/mysql.sql
index 13db8c7..178fb57 100644
--- a/srvs/mysql.sql
+++ b/srvs/mysql.sql
@@ -180,8 +180,10 @@ CREATE TABLE issues (
     guid        varchar(8)          NOT NULL,
     numb        int(32)             NOT NULL    DEFAULT 0,
     assignee    varchar(8)          NOT NULL    DEFAULT '',
+    author      varchar(8)          NOT NULL    DEFAULT '',
     seen        int(1)              NOT NULL    DEFAULT 0,      /* has the assignee seen this yet? */
     description text                NOT NULL,
+    authored    varchar(64)         NOT NULL    DEFAULT '',
     due         varchar(64)         NOT NULL    DEFAULT '',
     tags        text                NOT NULL,
 
-- 
cgit v1.2.3


From b093b3affe3ac6878e2242bff310dc466687a825 Mon Sep 17 00:00:00 2001
From: Malf Furious <m@lfurio.us>
Date: Sat, 20 Oct 2018 21:43:46 -0400
Subject: issue:  Add open/close data

---
 srvs/mysql.sql | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'srvs/mysql.sql')

diff --git a/srvs/mysql.sql b/srvs/mysql.sql
index 178fb57..9f3193b 100644
--- a/srvs/mysql.sql
+++ b/srvs/mysql.sql
@@ -181,9 +181,12 @@ CREATE TABLE issues (
     numb        int(32)             NOT NULL    DEFAULT 0,
     assignee    varchar(8)          NOT NULL    DEFAULT '',
     author      varchar(8)          NOT NULL    DEFAULT '',
+    closer      varchar(8)          NOT NULL    DEFAULT '',
     seen        int(1)              NOT NULL    DEFAULT 0,      /* has the assignee seen this yet? */
     description text                NOT NULL,
+    opened      varchar(64)         NOT NULL    DEFAULT '',
     authored    varchar(64)         NOT NULL    DEFAULT '',
+    closed      varchar(64)         NOT NULL    DEFAULT '',
     due         varchar(64)         NOT NULL    DEFAULT '',
     tags        text                NOT NULL,
 
-- 
cgit v1.2.3


From b690505b0e1e255e5081adcf49c724186bb831c2 Mon Sep 17 00:00:00 2001
From: Malf Furious <m@lfurio.us>
Date: Sat, 20 Oct 2018 21:49:32 -0400
Subject: issue:  Add assigned timestamp

---
 srvs/mysql.sql | 1 +
 1 file changed, 1 insertion(+)

(limited to 'srvs/mysql.sql')

diff --git a/srvs/mysql.sql b/srvs/mysql.sql
index 9f3193b..9bad437 100644
--- a/srvs/mysql.sql
+++ b/srvs/mysql.sql
@@ -185,6 +185,7 @@ CREATE TABLE issues (
     seen        int(1)              NOT NULL    DEFAULT 0,      /* has the assignee seen this yet? */
     description text                NOT NULL,
     opened      varchar(64)         NOT NULL    DEFAULT '',
+    assigned    varchar(64)         NOT NULL    DEFAULT '',
     authored    varchar(64)         NOT NULL    DEFAULT '',
     closed      varchar(64)         NOT NULL    DEFAULT '',
     due         varchar(64)         NOT NULL    DEFAULT '',
-- 
cgit v1.2.3


From 479fa31398d18f105616de83b5b5108278b75c59 Mon Sep 17 00:00:00 2001
From: Malf Furious <m@lfurio.us>
Date: Sun, 21 Oct 2018 21:18:21 -0400
Subject: issue:  Redesign schema

I found myself complicating the data model of this class of objects and
wanted to take a clean approach to its design.  The key differences are
as follows:

        * We now reference a message object for the issue's OP, as
        opposed to directly containing the message data

        This affords the OP _all_ of the standard features of a Scrott
        message, including separately tracked authorship data, file
        attachments.

        * Multiple assignees is implemented in the design

        Finally.

        * Seen flag is removed

        This can be implicitly tracked via all sub-object messages and
        the views meta-table.
---
 srvs/mysql.sql | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

(limited to 'srvs/mysql.sql')

diff --git a/srvs/mysql.sql b/srvs/mysql.sql
index 9bad437..72167d4 100644
--- a/srvs/mysql.sql
+++ b/srvs/mysql.sql
@@ -69,6 +69,23 @@ CREATE TABLE views (
     PRIMARY KEY (guid, viewer)
 );
 
+/*
+ * Scrott issues may have multiple assignees.  This table is used to
+ * co-relate assignees and issues along with additional meta-data.
+ */
+DROP TABLE IF EXISTS assignees;
+CREATE TABLE assignees (
+    guid        varchar(8)          NOT NULL,                   /* guid of issue */
+    assignee    varchar(8)          NOT NULL,                   /* user */
+    assigner    varchar(8)          NOT NULL,                   /* user */
+    assigned    datetime            NOT NULL,                   /* timestamp */
+    dismisser   varchar(8)          NOT NULL    DEFAULT '',     /* user */
+    dismissed   varchar(64)         NOT NULL    DEFAULT '',     /* timestamp */
+    signedoff   varchar(64)         NOT NULL    DEFAULT '',     /* timestamp */
+
+    PRIMARY KEY (guid, assignee)
+);
+
 /*
  * Base table for Scrott objects
  *
@@ -179,16 +196,10 @@ DROP TABLE IF EXISTS issues;
 CREATE TABLE issues (
     guid        varchar(8)          NOT NULL,
     numb        int(32)             NOT NULL    DEFAULT 0,
-    assignee    varchar(8)          NOT NULL    DEFAULT '',
-    author      varchar(8)          NOT NULL    DEFAULT '',
-    closer      varchar(8)          NOT NULL    DEFAULT '',
-    seen        int(1)              NOT NULL    DEFAULT 0,      /* has the assignee seen this yet? */
-    description text                NOT NULL,
-    opened      varchar(64)         NOT NULL    DEFAULT '',
-    assigned    varchar(64)         NOT NULL    DEFAULT '',
-    authored    varchar(64)         NOT NULL    DEFAULT '',
-    closed      varchar(64)         NOT NULL    DEFAULT '',
-    due         varchar(64)         NOT NULL    DEFAULT '',
+    mesg        varchar(8)          NOT NULL    DEFAULT '',
+    closer      varchar(8)          NOT NULL    DEFAULT '',     /* user */
+    closed      varchar(64)         NOT NULL    DEFAULT '',     /* timestamp */
+    due         varchar(64)         NOT NULL    DEFAULT '',     /* timestamp */
     tags        text                NOT NULL,
 
     PRIMARY KEY (guid)
-- 
cgit v1.2.3

