From 350fcc8f5f559dcf73d145d179666208e9dfe3ca Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Mon, 21 Sep 2015 12:46:55 -0500
Subject: [PATCH] queue: Add install and migration scripts

---
 .../streams/core/98ad7d55-00000000.patch.sql  | 31 +++++++++++++++++++
 setup/inc/streams/core/install-mysql.sql      | 21 +++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 include/upgrader/streams/core/98ad7d55-00000000.patch.sql

diff --git a/include/upgrader/streams/core/98ad7d55-00000000.patch.sql b/include/upgrader/streams/core/98ad7d55-00000000.patch.sql
new file mode 100644
index 000000000..3aaa133a1
--- /dev/null
+++ b/include/upgrader/streams/core/98ad7d55-00000000.patch.sql
@@ -0,0 +1,31 @@
+/**
+ * @version v1.11
+ * @signature 00000000000000000000000000000000
+ *
+ * Add custom queues, custom columns, and quick filter capabilities to the
+ * system.
+ */
+
+ALTER TABLE `%TABLE_PREFIX%queue`
+  ADD `filter` varchar(64) AFTER `config`,
+  ADD `root` varchar(32) DEFAULT NULL AFTER `filter`,
+  ADD `path` varchar(80) NOT NULL DEFAULT '/' AFTER `root`;
+
+DROP TABLE IF EXISTS `%TABLE_PREFIX%queue_column`;
+CREATE TABLE `%TABLE_PREFIX%queue_column` (
+  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+  `queue_id` int(10) unsigned NOT NULL,
+  `flags` int(10) unsigned NOT NULL DEFAULT '0',
+  `sort` int(10) unsigned NOT NULL DEFAULT '0',
+  `heading` varchar(64) NOT NULL DEFAULT '',
+  `primary` varchar(64) NOT NULL DEFAULT '',
+  `secondary` varchar(64) DEFAULT NULL,
+  `width` int(10) unsigned DEFAULT NULL,
+  `link` varchar(32) DEFAULT NULL,
+  `truncate` varchar(16) DEFAULT NULL,
+  `annotations` text,
+  `conditions` text,
+  `extra` text,
+  PRIMARY KEY (`id`)
+) DEFAULT CHARSET=utf8;
+
diff --git a/setup/inc/streams/core/install-mysql.sql b/setup/inc/streams/core/install-mysql.sql
index 105d0420a..6e75f1c65 100644
--- a/setup/inc/streams/core/install-mysql.sql
+++ b/setup/inc/streams/core/install-mysql.sql
@@ -832,11 +832,32 @@ CREATE TABLE `%TABLE_PREFIX%queue` (
   `sort` int(11) unsigned not null default 0,
   `title` varchar(60),
   `config` text,
+  `filter` varchar(64),
+  `root` varchar(32) DEFAULT NULL,
+  `path` varchar(80) NOT NULL DEFAULT '/',
   `created` datetime not null,
   `updated` datetime not null,
   primary key (`id`)
 ) DEFAULT CHARSET=utf8;
 
+DROP TABLE IF EXISTS `%TABLE_PREFIX%queue_column`;
+CREATE TABLE `%TABLE_PREFIX%queue_column` (
+  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+  `queue_id` int(10) unsigned NOT NULL,
+  `flags` int(10) unsigned NOT NULL DEFAULT '0',
+  `sort` int(10) unsigned NOT NULL DEFAULT '0',
+  `heading` varchar(64) NOT NULL DEFAULT '',
+  `primary` varchar(64) NOT NULL DEFAULT '',
+  `secondary` varchar(64) DEFAULT NULL,
+  `width` int(10) unsigned DEFAULT NULL,
+  `link` varchar(32) DEFAULT NULL,
+  `truncate` varchar(16) DEFAULT NULL,
+  `annotations` text,
+  `conditions` text,
+  `extra` text,
+  PRIMARY KEY (`id`)
+) DEFAULT CHARSET=utf8;
+
 DROP TABLE IF EXISTS `%TABLE_PREFIX%translation`;
 CREATE TABLE `%TABLE_PREFIX%translation` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
-- 
GitLab