DROP TABLE IF EXISTS `#__billets_addons`;

CREATE TABLE IF NOT EXISTS `#__billets_addons` (
  `id` int(11) NOT NULL auto_increment,
  `type` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `filename` varchar(255) NOT NULL,
  `published` tinyint(1) NOT NULL,
  `order` int(11) NOT NULL,
  `access` tinyint(3) NOT NULL,
  `iscore` tinyint(1) NOT NULL,
  `checked_out` int(11) unsigned NOT NULL default '0',
  `checked_out_time` datetime NOT NULL,
  `version` varchar(255) NOT NULL,
  `created_datetime` datetime NOT NULL,
  `author_name` varchar(255) NOT NULL,
  `author_email` varchar(255) NOT NULL,
  `author_url` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM ;

INSERT INTO `#__billets_addons` (`id`, `type`, `title`, `description`, `filename`, `published`, `order`, `access`, `iscore`, `checked_out`, `checked_out_time`, `version`, `created_datetime`, `author_name`, `author_email`, `author_url`) VALUES
(1, 'mod', 'Open Billets', 'This module displays on the admin side how many open billets there are', 'mod_billets_open_admin', 1, 0, 0, 1, 0, '0000-00-00 00:00:00', '0.1', '2008-03-06 17:53:43', 'Dioscouri Design', 'info@dioscouri.com', 'http://www.dioscouri.com'),
(2, 'mod', 'Tickets for Followup', 'This displays the number of tickets requiring a follow-up', 'mod_billets_followup', 1, 1, 0, 1, 0, '0000-00-00 00:00:00', '0.1', '2008-03-07 00:08:20', 'Dioscouri Design', 'info@dioscouri.com', 'http://www.dioscouri.com'),
(3, 'lang', 'English Language File', 'English definitions of constants', 'english', 1, 0, 0, 1, 0, '0000-00-00 00:00:00', '0.1', '2008-03-08 09:23:52', 'Dioscouri Design', 'info@dioscouri.com', 'http://www.dioscouri.com'),
(4, 'mod', 'Billets Feedback Stats', 'Displays Feeback Stats', 'mod_billets_feedbackstats', 1, 2, 0, 0, 0, '0000-00-00 00:00:00', '0.1', '2008-03-14 00:00:00', 'Dioscouri.com', 'info@dioscouri.com', 'http://www.dioscouri.com');


CREATE TABLE IF NOT EXISTS `#__billets_messages` (
  `id` int(11) NOT NULL auto_increment,
  `ticketid` int(11) NOT NULL,
  `userid_from` int(11) NOT NULL,
  `username_from` varchar(255) NOT NULL,
  `subject` text NOT NULL,
  `message` text NOT NULL,
  `priority` int(11) NOT NULL,
  `datetime` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM ;


CREATE TABLE IF NOT EXISTS `#__billets_tickets` (
  `id` int(11) NOT NULL auto_increment,
  `sender_email` varchar(255) NOT NULL,
  `sender_userid` int(11) NOT NULL,
  `sender_read_datetime` datetime NOT NULL,
  `sender_flag_read` tinyint(1) NOT NULL,
  `type` varchar(255) NOT NULL,
  `entrytype` tinyint(1) NOT NULL,
  `entryid` int(11) NOT NULL,
  `target_datetime` datetime NOT NULL,
  `manager_userid` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `feedback_by` int(11) NOT NULL,
  `feedback_datetime` datetime NOT NULL,
  `feedback_rating` varchar(11) NOT NULL,
  `closed_by` int(11) NOT NULL,
  `closed_datetime` datetime NOT NULL,
  `created_by` int(11) NOT NULL,
  `created_datetime` datetime NOT NULL,
  `last_modified_by` int(11) NOT NULL,
  `last_modified_datetime` datetime NOT NULL,
  `published` tinyint(1) NOT NULL,
  `followup` tinyint(1) NOT NULL,
  `firstresponse_by` int(11) NOT NULL,
  `firstresponse_datetime` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM ;
