/**
 * 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',
  `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 '',
  `customerphone` varchar(255) NOT NULL DEFAULT '',
  `title` varchar(255) NOT NULL DEFAULT '',
  `blurb` text NOT NULL,
  `lang` char(5) NOT NULL DEFAULT 'de_DE',
  `sacid` int(11) unsigned NOT NULL DEFAULT '0',
  `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',
  `uid` int(11) unsigned NOT NULL DEFAULT '0',
  `serial` varchar(255) NOT NULL DEFAULT '',
  `customeraddress` varchar(255) NOT NULL DEFAULT '',
  `customerzip` varchar(256) NOT NULL DEFAULT '',
  `customertown` varchar(255) NOT NULL DEFAULT '',
  `customercountry` char(2) NOT NULL DEFAULT 'C',
  `customercompany` varchar(255) NOT NULL DEFAULT '',
  `namespace` char(25) NOT NULL DEFAULT '',
  PRIMARY KEY (`ticid`),
  KEY `status` (`status`),
  KEY `assigneduid` (`assigneduid`),
  KEY `namespace` (`namespace`)
) ENGINE=MyISAM AUTO_INCREMENT=449 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';
