#
# TTicket Database structure
#
# Replace `__your_username__` (at the end of file) with 
# your real username and run this sql script in an 
# existent DB
#
# --------------------------------------------------------

#
# Table structure for table `tickets`
#

CREATE TABLE `tickets` (
  `cod` int(11) NOT NULL auto_increment,
  `sndname` varchar(40) NOT NULL default '',
  `subject` tinytext NOT NULL,
  `description` text NOT NULL,
  `opendate` datetime NOT NULL default '0000-00-00 00:00:00',
  `closedate` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` tinyint(4) NOT NULL default '0',
  `priority` tinyint(4) NOT NULL default '0',
  `type1` tinyint(4) NOT NULL default '0',
  `type2` tinyint(4) NOT NULL default '0',
  `updates` text,
  `email` varchar(40) default NULL,
  `working` tinyint(4) NOT NULL default '0',
  `ref_email` varchar(200) default NULL,
  `timeofclosing` bigint(20) default NULL,
  `credits` int(11) default NULL,
  `sndgroup` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`cod`),
  KEY `st-t1-wk-pr-od` (`status`,`type1`,`working`,`priority`,`opendate`)
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `del_tickets`
#

CREATE TABLE `del_tickets` (
  `cod` int(11) NOT NULL default '0',
  `sndname` varchar(40) NOT NULL default '',
  `subject` tinytext NOT NULL,
  `description` text NOT NULL,
  `opendate` datetime NOT NULL default '0000-00-00 00:00:00',
  `closedate` datetime NOT NULL default '0000-00-00 00:00:00',
  `status` smallint(6) NOT NULL default '0',
  `priority` int(11) NOT NULL default '0',
  `type1` varchar(20) NOT NULL default '',
  `type2` varchar(20) NOT NULL default '',
  `updates` text,
  `email` varchar(40) default NULL,
  `working` tinyint(4) NOT NULL default '0',
  `ref_email` varchar(200) default NULL,
  `timeofclosing` bigint(20) default NULL,
  `credits` int(11) default NULL,
  `sndgroup` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`cod`)
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `type1`
#

CREATE TABLE `type1` (
  `id` int(11) NOT NULL default '0',
  `name` varchar(20) NOT NULL default '',
  `include_page` varchar(100) default NULL,
  `priority_lock` char(3) default NULL,
  `type2_lock` char(3) default NULL,
  `email` varchar(100) default NULL,
  `options` varchar(100) default NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `type2`
#

CREATE TABLE `type2` (
  `id` int(11) NOT NULL default '0',
  `name` varchar(10) NOT NULL default '',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;
# --------------------------------------------------------

#
# Table structure for table `users`
#

CREATE TABLE `users` (
  `user` varchar(40) NOT NULL default '',
  `admin` smallint(1) NOT NULL default '1',
  `type1` varchar(40) default '0, 1, 2',
  `templates` longtext,
  UNIQUE KEY `user` (`user`)
) TYPE=MyISAM;

INSERT INTO `users` ( `user` , `admin`, `type1` ) VALUES ( '__your_username__', '0', '0, 1,');

