/**
 * Incident Ticket System
 */

CREATE TABLE `wbticket` (
  `ticid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `obscure` char(4) NOT NULL DEFAULT '',
  `status` enum('new', 'trash', 'assigned', 'waitforstaff', 'waitforcustomer','solved', 'closed') NOT NULL DEFAULT 'new',
  `uid` int(11) unsigned NOT NULL DEFAULT '0',
  `assigneduid` int(11) unsigned NOT NULL DEFAULT '0',
  `customeruid` int(11) unsigned NOT NULL DEFAULT '0',
  `customeremailurlid` int(11) unsigned NOT NULL DEFAULT '0',
  `customername` varchar(255) NOT NULL DEFAULT '',
  `title` varchar(255) NOT NULL DEFAULT '',
  `blurb` text NOT NULL DEFAULT '',
  `created` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
  `changed` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
  `statuschanged` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
  `deleted` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ticid`),
  KEY (status),
  KEY (assigneduid)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='Ticket system: tickets';

CREATE TABLE `wbticketmedia` (
  `ticid` int(11) unsigned NOT NULL,
  `vfsfid` int(11) unsigned NOT NULL,
  KEY `ticid` (`ticid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Ticket system: media files of ticket';
