summaryrefslogtreecommitdiffstats
path: root/srvs
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-10-21 21:18:21 -0400
committerMalf Furious <m@lfurio.us>2018-10-21 21:29:26 -0400
commit479fa31398d18f105616de83b5b5108278b75c59 (patch)
tree8bb2192a973503cf9f350188f8354530f4f05b37 /srvs
parent62872702dc413b7abab94d8a5a7bd21770b5d241 (diff)
downloadscrott-479fa31398d18f105616de83b5b5108278b75c59.tar.gz
scrott-479fa31398d18f105616de83b5b5108278b75c59.zip
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.
Diffstat (limited to 'srvs')
-rw-r--r--srvs/mysql.sql31
1 files changed, 21 insertions, 10 deletions
diff --git a/srvs/mysql.sql b/srvs/mysql.sql
index 9bad437..72167d4 100644
--- a/srvs/mysql.sql
+++ b/srvs/mysql.sql
@@ -70,6 +70,23 @@ CREATE TABLE views (
);
/*
+ * 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
*
* Explaination of permissions...
@@ -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)