Skip to content
Snippets Groups Projects
Commit 55e1c8ec authored by Jared Hancock's avatar Jared Hancock
Browse files

Use database default storage engine

Drop required usage of MyISAM tables, and drop fulltext indexes as they
are not used in the code currently anyway. Also, use a blob to store
session data so as not to waste space with UTF-8 encoding. Lastly, fix
session_id storage to use VARCHAR(255) which is required for versions
of MySQL < 5.0.3, and use ascii for the storage model for the
session_id as it will contain simple characters only.
parent c83248ce
Branches
Tags
No related merge requests found
...@@ -72,7 +72,7 @@ class osTicketSession { ...@@ -72,7 +72,7 @@ class osTicketSession {
$sql='REPLACE INTO '.SESSION_TABLE.' SET session_updated=NOW() '. $sql='REPLACE INTO '.SESSION_TABLE.' SET session_updated=NOW() '.
',session_id='.db_input($id). ',session_id='.db_input($id).
',session_data='.db_input($data). ',session_data=0x'.bin2hex($data).
',session_expire=(NOW() + INTERVAL '.$ttl.' SECOND)'. ',session_expire=(NOW() + INTERVAL '.$ttl.' SECOND)'.
',user_id='.db_input($thisstaff?$thisstaff->getId():0). ',user_id='.db_input($thisstaff?$thisstaff->getId():0).
',user_ip='.db_input($_SERVER['REMOTE_ADDR']). ',user_ip='.db_input($_SERVER['REMOTE_ADDR']).
......
...@@ -119,21 +119,12 @@ if($search): ...@@ -119,21 +119,12 @@ if($search):
//This sucks..mass scan! search anything that moves! //This sucks..mass scan! search anything that moves!
$deep_search=true; $deep_search=true;
if($_REQUEST['stype'] && $_REQUEST['stype']=='FT') { //Using full text on big fields. $qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".
$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'". " OR ticket.name LIKE '%$queryterm%'".
" OR ticket.name LIKE '%$queryterm%'". " OR ticket.subject LIKE '%$queryterm%'".
" OR ticket.subject LIKE '%$queryterm%'". " OR thread.body LIKE '%$queryterm%'".
" OR thread.title LIKE '%$queryterm%'". " OR thread.title LIKE '%$queryterm%'".
" OR MATCH(thread.body) AGAINST('$queryterm')". ' ) ';
' ) ';
}else{
$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".
" OR ticket.name LIKE '%$queryterm%'".
" OR ticket.subject LIKE '%$queryterm%'".
" OR thread.body LIKE '%$queryterm%'".
" OR thread.title LIKE '%$queryterm%'".
' ) ';
}
} }
} }
//department //department
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* servers. No significant changes need to be rolled for continuous updaters * servers. No significant changes need to be rolled for continuous updaters
* *
* @version v1.7.1 * @version v1.7.1
* @signature 557cc9f9a663c56c259604ee1fe2e1fd * @signature 892866ae9af89d40415b738bbde54a15
*/ */
-- update schema signature -- update schema signature
UPDATE `%TABLE_PREFIX%config` UPDATE `%TABLE_PREFIX%config`
SET `schema_signature`='557cc9f9a663c56c259604ee1fe2e1fd'; SET `schema_signature`='892866ae9af89d40415b738bbde54a15';
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
#Current version && schema signature (Changes from version to version) #Current version && schema signature (Changes from version to version)
define('THIS_VERSION','1.7.0+'); //Shown on admin panel define('THIS_VERSION','1.7.0+'); //Shown on admin panel
define('SCHEMA_SIGNATURE', '557cc9f9a663c56c259604ee1fe2e1fd'); //MD5 signature of the db schema. (used to trigger upgrades) define('SCHEMA_SIGNATURE', '892866ae9af89d40415b738bbde54a15'); //MD5 signature of the db schema. (used to trigger upgrades)
#load config info #load config info
$configfile=''; $configfile='';
if(file_exists(ROOT_DIR.'ostconfig.php')) //Old installs prior to v 1.6 RC5 if(file_exists(ROOT_DIR.'ostconfig.php')) //Old installs prior to v 1.6 RC5
......
...@@ -13,7 +13,7 @@ CREATE TABLE `%TABLE_PREFIX%api_key` ( ...@@ -13,7 +13,7 @@ CREATE TABLE `%TABLE_PREFIX%api_key` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `ipaddr` (`ipaddr`), KEY `ipaddr` (`ipaddr`),
UNIQUE KEY `apikey` (`apikey`) UNIQUE KEY `apikey` (`apikey`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%faq`; DROP TABLE IF EXISTS `%TABLE_PREFIX%faq`;
CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq` ( CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq` (
...@@ -29,16 +29,15 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq` ( ...@@ -29,16 +29,15 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq` (
PRIMARY KEY (`faq_id`), PRIMARY KEY (`faq_id`),
UNIQUE KEY `question` (`question`), UNIQUE KEY `question` (`question`),
KEY `category_id` (`category_id`), KEY `category_id` (`category_id`),
KEY `ispublished` (`ispublished`), KEY `ispublished` (`ispublished`)
FULLTEXT KEY `faq` (`question`,`answer`,`keywords`) ) DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_attachment`; DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_attachment`;
CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_attachment` ( CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_attachment` (
`faq_id` int(10) unsigned NOT NULL, `faq_id` int(10) unsigned NOT NULL,
`file_id` int(10) unsigned NOT NULL, `file_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`faq_id`,`file_id`) PRIMARY KEY (`faq_id`,`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_category`; DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_category`;
CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_category` ( CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_category` (
...@@ -51,14 +50,14 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_category` ( ...@@ -51,14 +50,14 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_category` (
`updated` date NOT NULL, `updated` date NOT NULL,
PRIMARY KEY (`category_id`), PRIMARY KEY (`category_id`),
KEY (`ispublic`) KEY (`ispublic`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_topic`; DROP TABLE IF EXISTS `%TABLE_PREFIX%faq_topic`;
CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_topic` ( CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%faq_topic` (
`faq_id` int(10) unsigned NOT NULL, `faq_id` int(10) unsigned NOT NULL,
`topic_id` int(10) unsigned NOT NULL, `topic_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`faq_id`,`topic_id`) PRIMARY KEY (`faq_id`,`topic_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%config`; DROP TABLE IF EXISTS `%TABLE_PREFIX%config`;
CREATE TABLE `%TABLE_PREFIX%config` ( CREATE TABLE `%TABLE_PREFIX%config` (
...@@ -163,7 +162,7 @@ CREATE TABLE `%TABLE_PREFIX%config` ( ...@@ -163,7 +162,7 @@ CREATE TABLE `%TABLE_PREFIX%config` (
`updated` timestamp NOT NULL default CURRENT_TIMESTAMP, `updated` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `isoffline` (`isonline`) KEY `isoffline` (`isonline`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%sla`; DROP TABLE IF EXISTS `%TABLE_PREFIX%sla`;
CREATE TABLE `%TABLE_PREFIX%sla` ( CREATE TABLE `%TABLE_PREFIX%sla` (
...@@ -178,7 +177,7 @@ CREATE TABLE `%TABLE_PREFIX%sla` ( ...@@ -178,7 +177,7 @@ CREATE TABLE `%TABLE_PREFIX%sla` (
`updated` datetime NOT NULL, `updated` datetime NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`) UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%sla` (`isactive`, `enable_priority_escalation`, INSERT INTO `%TABLE_PREFIX%sla` (`isactive`, `enable_priority_escalation`,
`disable_overdue_alerts`, `grace_period`, `name`, `notes`, `created`, `updated`) `disable_overdue_alerts`, `grace_period`, `name`, `notes`, `created`, `updated`)
...@@ -205,7 +204,7 @@ CREATE TABLE `%TABLE_PREFIX%department` ( ...@@ -205,7 +204,7 @@ CREATE TABLE `%TABLE_PREFIX%department` (
KEY `manager_id` (`manager_id`), KEY `manager_id` (`manager_id`),
KEY `autoresp_email_id` (`autoresp_email_id`), KEY `autoresp_email_id` (`autoresp_email_id`),
KEY `tpl_id` (`tpl_id`) KEY `tpl_id` (`tpl_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%department` (`sla_id`, `dept_name`, `dept_signature`, `ispublic`, `ticket_auto_response`, `message_auto_response`) VALUES INSERT INTO `%TABLE_PREFIX%department` (`sla_id`, `dept_name`, `dept_signature`, `ispublic`, `ticket_auto_response`, `message_auto_response`) VALUES
(0, 'Support', 'Support Dept', 1, 1, 1), (0, 'Support', 'Support Dept', 1, 1, 1),
...@@ -246,7 +245,7 @@ CREATE TABLE `%TABLE_PREFIX%email` ( ...@@ -246,7 +245,7 @@ CREATE TABLE `%TABLE_PREFIX%email` (
UNIQUE KEY `email` (`email`), UNIQUE KEY `email` (`email`),
KEY `priority_id` (`priority_id`), KEY `priority_id` (`priority_id`),
KEY `dept_id` (`dept_id`) KEY `dept_id` (`dept_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%filter`; DROP TABLE IF EXISTS `%TABLE_PREFIX%filter`;
CREATE TABLE `%TABLE_PREFIX%filter` ( CREATE TABLE `%TABLE_PREFIX%filter` (
...@@ -273,7 +272,7 @@ CREATE TABLE `%TABLE_PREFIX%filter` ( ...@@ -273,7 +272,7 @@ CREATE TABLE `%TABLE_PREFIX%filter` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `target` (`target`), KEY `target` (`target`),
KEY `email_id` (`email_id`) KEY `email_id` (`email_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%filter` ( INSERT INTO `%TABLE_PREFIX%filter` (
...@@ -294,7 +293,7 @@ CREATE TABLE `%TABLE_PREFIX%filter_rule` ( ...@@ -294,7 +293,7 @@ CREATE TABLE `%TABLE_PREFIX%filter_rule` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `filter_id` (`filter_id`), KEY `filter_id` (`filter_id`),
UNIQUE `filter` (`filter_id`, `what`, `how`, `val`) UNIQUE `filter` (`filter_id`, `what`, `how`, `val`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%filter_rule` ( INSERT INTO `%TABLE_PREFIX%filter_rule` (
`filter_id`, `isactive`, `what`,`how`,`val`,`created`) `filter_id`, `isactive`, `what`,`how`,`val`,`created`)
...@@ -334,9 +333,8 @@ CREATE TABLE `%TABLE_PREFIX%email_template` ( ...@@ -334,9 +333,8 @@ CREATE TABLE `%TABLE_PREFIX%email_template` (
`created` datetime NOT NULL, `created` datetime NOT NULL,
`updated` datetime NOT NULL, `updated` datetime NOT NULL,
PRIMARY KEY (`tpl_id`), PRIMARY KEY (`tpl_id`),
KEY `cfg_id` (`cfg_id`), KEY `cfg_id` (`cfg_id`)
FULLTEXT KEY `message_subj` (`ticket_reply_subj`) ) DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- TODO: Dump revised copy before release!!! -- TODO: Dump revised copy before release!!!
INSERT INTO `%TABLE_PREFIX%email_template` (`isactive`, `name`, `notes`, `ticket_autoresp_subj`, `ticket_autoresp_body`, `ticket_autoreply_subj`, `ticket_autoreply_body`, `ticket_notice_subj`, `ticket_notice_body`, `ticket_alert_subj`, `ticket_alert_body`, `message_autoresp_subj`, `message_autoresp_body`, `message_alert_subj`, `message_alert_body`, `note_alert_subj`, `note_alert_body`, `assigned_alert_subj`, `assigned_alert_body`, `transfer_alert_subj`, `transfer_alert_body`, `ticket_overdue_subj`, `ticket_overdue_body`, `ticket_overlimit_subj`, `ticket_overlimit_body`, `ticket_reply_subj`, `ticket_reply_body`, `created`, `updated`) VALUES INSERT INTO `%TABLE_PREFIX%email_template` (`isactive`, `name`, `notes`, `ticket_autoresp_subj`, `ticket_autoresp_body`, `ticket_autoreply_subj`, `ticket_autoreply_body`, `ticket_notice_subj`, `ticket_notice_body`, `ticket_alert_subj`, `ticket_alert_body`, `message_autoresp_subj`, `message_autoresp_body`, `message_alert_subj`, `message_alert_body`, `note_alert_subj`, `note_alert_body`, `assigned_alert_subj`, `assigned_alert_body`, `transfer_alert_subj`, `transfer_alert_body`, `ticket_overdue_subj`, `ticket_overdue_body`, `ticket_overlimit_subj`, `ticket_overlimit_body`, `ticket_reply_subj`, `ticket_reply_body`, `created`, `updated`) VALUES
...@@ -352,7 +350,7 @@ CREATE TABLE `%TABLE_PREFIX%file` ( ...@@ -352,7 +350,7 @@ CREATE TABLE `%TABLE_PREFIX%file` (
`created` datetime NOT NULL, `created` datetime NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `hash` (`hash`) KEY `hash` (`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%file` (`type`, `size`, `hash`, `name`, `created`) VALUES INSERT INTO `%TABLE_PREFIX%file` (`type`, `size`, `hash`, `name`, `created`) VALUES
('text/plain', '25', '670c6cc1d1dfc97fad20e5470251b255', 'osTicket.txt', NOW()); ('text/plain', '25', '670c6cc1d1dfc97fad20e5470251b255', 'osTicket.txt', NOW());
...@@ -363,7 +361,7 @@ CREATE TABLE `%TABLE_PREFIX%file_chunk` ( ...@@ -363,7 +361,7 @@ CREATE TABLE `%TABLE_PREFIX%file_chunk` (
`chunk_id` int(11) NOT NULL, `chunk_id` int(11) NOT NULL,
`filedata` longblob NOT NULL, `filedata` longblob NOT NULL,
PRIMARY KEY (`file_id`, `chunk_id`) PRIMARY KEY (`file_id`, `chunk_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%file_chunk` (`file_id`, `chunk_id`, `filedata`) INSERT INTO `%TABLE_PREFIX%file_chunk` (`file_id`, `chunk_id`, `filedata`)
VALUES (LAST_INSERT_ID(), 0, 0x43616e6e6564206174746163686d656e747320726f636b210a); VALUES (LAST_INSERT_ID(), 0, 0x43616e6e6564206174746163686d656e747320726f636b210a);
...@@ -389,7 +387,7 @@ CREATE TABLE `%TABLE_PREFIX%groups` ( ...@@ -389,7 +387,7 @@ CREATE TABLE `%TABLE_PREFIX%groups` (
`updated` datetime NOT NULL, `updated` datetime NOT NULL,
PRIMARY KEY (`group_id`), PRIMARY KEY (`group_id`),
KEY `group_active` (`group_enabled`) KEY `group_active` (`group_enabled`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%groups` (`group_enabled`, `group_name`, `can_create_tickets`, `can_edit_tickets`, `can_delete_tickets`, `can_close_tickets`, `can_assign_tickets`, `can_transfer_tickets`, `can_ban_emails`, `can_manage_premade`, `can_manage_faq`, `notes`, `created`, `updated`) VALUES INSERT INTO `%TABLE_PREFIX%groups` (`group_enabled`, `group_name`, `can_create_tickets`, `can_edit_tickets`, `can_delete_tickets`, `can_close_tickets`, `can_assign_tickets`, `can_transfer_tickets`, `can_ban_emails`, `can_manage_premade`, `can_manage_faq`, `notes`, `created`, `updated`) VALUES
(1, 'Admins', 1, 1, 1, 1, 1, 1, 1, 1, 1, 'overlords', NOW(), NOW()), (1, 'Admins', 1, 1, 1, 1, 1, 1, 1, 1, 1, 'overlords', NOW(), NOW()),
...@@ -402,7 +400,7 @@ CREATE TABLE `%TABLE_PREFIX%group_dept_access` ( ...@@ -402,7 +400,7 @@ CREATE TABLE `%TABLE_PREFIX%group_dept_access` (
`dept_id` int(10) unsigned NOT NULL default '0', `dept_id` int(10) unsigned NOT NULL default '0',
UNIQUE KEY `group_dept` (`group_id`,`dept_id`), UNIQUE KEY `group_dept` (`group_id`,`dept_id`),
KEY `dept_id` (`dept_id`) KEY `dept_id` (`dept_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%group_dept_access` (`group_id`, `dept_id`) INSERT INTO `%TABLE_PREFIX%group_dept_access` (`group_id`, `dept_id`)
SELECT `%TABLE_PREFIX%groups`.`group_id`, `%TABLE_PREFIX%department`.`dept_id` SELECT `%TABLE_PREFIX%groups`.`group_id`, `%TABLE_PREFIX%department`.`dept_id`
...@@ -431,7 +429,7 @@ CREATE TABLE `%TABLE_PREFIX%help_topic` ( ...@@ -431,7 +429,7 @@ CREATE TABLE `%TABLE_PREFIX%help_topic` (
KEY `dept_id` (`dept_id`), KEY `dept_id` (`dept_id`),
KEY `staff_id` (`staff_id`,`team_id`), KEY `staff_id` (`staff_id`,`team_id`),
KEY `sla_id` (`sla_id`) KEY `sla_id` (`sla_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%help_topic` (`isactive`, `ispublic`, `noautoresp`, `dept_id`, `sla_id`, `topic`, `notes`) VALUES INSERT INTO `%TABLE_PREFIX%help_topic` (`isactive`, `ispublic`, `noautoresp`, `dept_id`, `sla_id`, `topic`, `notes`) VALUES
(1, 1, 0, (SELECT `dept_id` FROM `%TABLE_PREFIX%department` ORDER BY `dept_id` LIMIT 1), (SELECT `id` FROM `%TABLE_PREFIX%sla` ORDER BY `id` LIMIT 1), 'Support', NULL), (1, 1, 0, (SELECT `dept_id` FROM `%TABLE_PREFIX%department` ORDER BY `dept_id` LIMIT 1), (SELECT `id` FROM `%TABLE_PREFIX%sla` ORDER BY `id` LIMIT 1), 'Support', NULL),
...@@ -450,9 +448,8 @@ CREATE TABLE `%TABLE_PREFIX%canned_response` ( ...@@ -450,9 +448,8 @@ CREATE TABLE `%TABLE_PREFIX%canned_response` (
PRIMARY KEY (`canned_id`), PRIMARY KEY (`canned_id`),
UNIQUE KEY `title` (`title`), UNIQUE KEY `title` (`title`),
KEY `dept_id` (`dept_id`), KEY `dept_id` (`dept_id`),
KEY `active` (`isenabled`), KEY `active` (`isenabled`)
FULLTEXT KEY `resp` (`title`,`response`) ) DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%canned_response` (`isenabled`, `title`, `response`) VALUES INSERT INTO `%TABLE_PREFIX%canned_response` (`isenabled`, `title`, `response`) VALUES
(1, 'What is osTicket (sample)?', '\r\nosTicket is a widely-used open source support ticket system, an attractive alternative to higher-cost and complex customer support systems - simple, lightweight, reliable, open source, web-based and easy to setup and use.'), (1, 'What is osTicket (sample)?', '\r\nosTicket is a widely-used open source support ticket system, an attractive alternative to higher-cost and complex customer support systems - simple, lightweight, reliable, open source, web-based and easy to setup and use.'),
...@@ -463,15 +460,15 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%canned_attachment` ( ...@@ -463,15 +460,15 @@ CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%canned_attachment` (
`canned_id` int(10) unsigned NOT NULL, `canned_id` int(10) unsigned NOT NULL,
`file_id` int(10) unsigned NOT NULL, `file_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`canned_id`,`file_id`) PRIMARY KEY (`canned_id`,`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%canned_attachment` (`canned_id`, `file_id`) INSERT INTO `%TABLE_PREFIX%canned_attachment` (`canned_id`, `file_id`)
VALUES (LAST_INSERT_ID(), (SELECT `id` FROM `%TABLE_PREFIX%file` ORDER BY `id` LIMIT 1)); VALUES (LAST_INSERT_ID(), (SELECT `id` FROM `%TABLE_PREFIX%file` ORDER BY `id` LIMIT 1));
DROP TABLE IF EXISTS `%TABLE_PREFIX%session`; DROP TABLE IF EXISTS `%TABLE_PREFIX%session`;
CREATE TABLE `%TABLE_PREFIX%session` ( CREATE TABLE `%TABLE_PREFIX%session` (
`session_id` varchar(256) collate utf8_unicode_ci NOT NULL default '', `session_id` varchar(255) collate ascii_general_ci NOT NULL default '',
`session_data` longtext collate utf8_unicode_ci, `session_data` blob,
`session_expire` datetime default NULL, `session_expire` datetime default NULL,
`session_updated` datetime default NULL, `session_updated` datetime default NULL,
`user_id` int(10) unsigned NOT NULL default '0' COMMENT 'osTicket staff ID', `user_id` int(10) unsigned NOT NULL default '0' COMMENT 'osTicket staff ID',
...@@ -480,7 +477,7 @@ CREATE TABLE `%TABLE_PREFIX%session` ( ...@@ -480,7 +477,7 @@ CREATE TABLE `%TABLE_PREFIX%session` (
PRIMARY KEY (`session_id`), PRIMARY KEY (`session_id`),
KEY `updated` (`session_updated`), KEY `updated` (`session_updated`),
KEY `user_id` (`user_id`) KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `%TABLE_PREFIX%staff`; DROP TABLE IF EXISTS `%TABLE_PREFIX%staff`;
CREATE TABLE `%TABLE_PREFIX%staff` ( CREATE TABLE `%TABLE_PREFIX%staff` (
...@@ -519,7 +516,7 @@ CREATE TABLE `%TABLE_PREFIX%staff` ( ...@@ -519,7 +516,7 @@ CREATE TABLE `%TABLE_PREFIX%staff` (
KEY `dept_id` (`dept_id`), KEY `dept_id` (`dept_id`),
KEY `issuperuser` (`isadmin`), KEY `issuperuser` (`isadmin`),
KEY `group_id` (`group_id`,`staff_id`) KEY `group_id` (`group_id`,`staff_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%syslog`; DROP TABLE IF EXISTS `%TABLE_PREFIX%syslog`;
CREATE TABLE `%TABLE_PREFIX%syslog` ( CREATE TABLE `%TABLE_PREFIX%syslog` (
...@@ -533,7 +530,7 @@ CREATE TABLE `%TABLE_PREFIX%syslog` ( ...@@ -533,7 +530,7 @@ CREATE TABLE `%TABLE_PREFIX%syslog` (
`updated` datetime NOT NULL, `updated` datetime NOT NULL,
PRIMARY KEY (`log_id`), PRIMARY KEY (`log_id`),
KEY `log_type` (`log_type`) KEY `log_type` (`log_type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%team`; DROP TABLE IF EXISTS `%TABLE_PREFIX%team`;
CREATE TABLE `%TABLE_PREFIX%team` ( CREATE TABLE `%TABLE_PREFIX%team` (
...@@ -549,7 +546,7 @@ CREATE TABLE `%TABLE_PREFIX%team` ( ...@@ -549,7 +546,7 @@ CREATE TABLE `%TABLE_PREFIX%team` (
UNIQUE KEY `name` (`name`), UNIQUE KEY `name` (`name`),
KEY `isnabled` (`isenabled`), KEY `isnabled` (`isenabled`),
KEY `lead_id` (`lead_id`) KEY `lead_id` (`lead_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%team` (`isenabled`, `noalerts`, `name`, `notes`, `created`, `updated`) INSERT INTO `%TABLE_PREFIX%team` (`isenabled`, `noalerts`, `name`, `notes`, `created`, `updated`)
VALUES (1, 0, 'Level I Support', '', NOW(), NOW()); VALUES (1, 0, 'Level I Support', '', NOW(), NOW());
...@@ -560,7 +557,7 @@ CREATE TABLE `%TABLE_PREFIX%team_member` ( ...@@ -560,7 +557,7 @@ CREATE TABLE `%TABLE_PREFIX%team_member` (
`staff_id` int(10) unsigned NOT NULL, `staff_id` int(10) unsigned NOT NULL,
`updated` datetime NOT NULL, `updated` datetime NOT NULL,
PRIMARY KEY (`team_id`,`staff_id`) PRIMARY KEY (`team_id`,`staff_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket`; DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket`;
CREATE TABLE `%TABLE_PREFIX%ticket` ( CREATE TABLE `%TABLE_PREFIX%ticket` (
...@@ -601,7 +598,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket` ( ...@@ -601,7 +598,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket` (
KEY `duedate` (`duedate`), KEY `duedate` (`duedate`),
KEY `topic_id` (`topic_id`), KEY `topic_id` (`topic_id`),
KEY `sla_id` (`sla_id`) KEY `sla_id` (`sla_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_attachment`; DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_attachment`;
CREATE TABLE `%TABLE_PREFIX%ticket_attachment` ( CREATE TABLE `%TABLE_PREFIX%ticket_attachment` (
...@@ -616,7 +613,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_attachment` ( ...@@ -616,7 +613,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_attachment` (
KEY `ref_type` (`ref_type`), KEY `ref_type` (`ref_type`),
KEY `ref_id` (`ref_id`), KEY `ref_id` (`ref_id`),
KEY `file_id` (`file_id`) KEY `file_id` (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_lock`; DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_lock`;
CREATE TABLE `%TABLE_PREFIX%ticket_lock` ( CREATE TABLE `%TABLE_PREFIX%ticket_lock` (
...@@ -628,7 +625,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_lock` ( ...@@ -628,7 +625,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_lock` (
PRIMARY KEY (`lock_id`), PRIMARY KEY (`lock_id`),
UNIQUE KEY `ticket_id` (`ticket_id`), UNIQUE KEY `ticket_id` (`ticket_id`),
KEY `staff_id` (`staff_id`) KEY `staff_id` (`staff_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_email_info`; DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_email_info`;
CREATE TABLE `%TABLE_PREFIX%ticket_email_info` ( CREATE TABLE `%TABLE_PREFIX%ticket_email_info` (
...@@ -636,7 +633,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_email_info` ( ...@@ -636,7 +633,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_email_info` (
`email_mid` varchar(255) NOT NULL, `email_mid` varchar(255) NOT NULL,
`headers` text, `headers` text,
KEY `message_id` (`email_mid`) KEY `message_id` (`email_mid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_event`; DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_event`;
CREATE TABLE `%TABLE_PREFIX%ticket_event` ( CREATE TABLE `%TABLE_PREFIX%ticket_event` (
...@@ -651,7 +648,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_event` ( ...@@ -651,7 +648,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_event` (
`timestamp` datetime NOT NULL, `timestamp` datetime NOT NULL,
KEY `ticket_state` (`ticket_id`, `state`, `timestamp`), KEY `ticket_state` (`ticket_id`, `state`, `timestamp`),
KEY `ticket_stats` (`timestamp`, `state`) KEY `ticket_stats` (`timestamp`, `state`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_priority`; DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_priority`;
CREATE TABLE `%TABLE_PREFIX%ticket_priority` ( CREATE TABLE `%TABLE_PREFIX%ticket_priority` (
...@@ -665,7 +662,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_priority` ( ...@@ -665,7 +662,7 @@ CREATE TABLE `%TABLE_PREFIX%ticket_priority` (
UNIQUE KEY `priority` (`priority`), UNIQUE KEY `priority` (`priority`),
KEY `priority_urgency` (`priority_urgency`), KEY `priority_urgency` (`priority_urgency`),
KEY `ispublic` (`ispublic`) KEY `ispublic` (`ispublic`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%ticket_priority` (`priority`, `priority_desc`, `priority_color`, `priority_urgency`, `ispublic`) VALUES INSERT INTO `%TABLE_PREFIX%ticket_priority` (`priority`, `priority_desc`, `priority_color`, `priority_urgency`, `ispublic`) VALUES
('low', 'Low', '#DDFFDD', 4, 1), ('low', 'Low', '#DDFFDD', 4, 1),
...@@ -690,9 +687,8 @@ CREATE TABLE `%TABLE_PREFIX%ticket_thread` ( ...@@ -690,9 +687,8 @@ CREATE TABLE `%TABLE_PREFIX%ticket_thread` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `ticket_id` (`ticket_id`), KEY `ticket_id` (`ticket_id`),
KEY `staff_id` (`staff_id`), KEY `staff_id` (`staff_id`),
KEY `pid` (`pid`), KEY `pid` (`pid`)
FULLTEXT KEY `body` (`body`) ) DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `%TABLE_PREFIX%timezone`; DROP TABLE IF EXISTS `%TABLE_PREFIX%timezone`;
CREATE TABLE `%TABLE_PREFIX%timezone` ( CREATE TABLE `%TABLE_PREFIX%timezone` (
...@@ -700,7 +696,7 @@ CREATE TABLE `%TABLE_PREFIX%timezone` ( ...@@ -700,7 +696,7 @@ CREATE TABLE `%TABLE_PREFIX%timezone` (
`offset` float(3,1) NOT NULL default '0.0', `offset` float(3,1) NOT NULL default '0.0',
`timezone` varchar(255) NOT NULL default '', `timezone` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) DEFAULT CHARSET=utf8;
INSERT INTO `%TABLE_PREFIX%timezone` (`offset`, `timezone`) VALUES INSERT INTO `%TABLE_PREFIX%timezone` (`offset`, `timezone`) VALUES
(-12.0, 'Eniwetok, Kwajalein'), (-12.0, 'Eniwetok, Kwajalein'),
......
557cc9f9a663c56c259604ee1fe2e1fd 892866ae9af89d40415b738bbde54a15
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment