DROP TABLE IF EXISTS `glpi_plugin_eventlog_config`;
CREATE TABLE `glpi_plugin_eventlog_config` (
	`ID` int(11) NOT NULL auto_increment,
	`eventlog_db_user` varchar(255) NOT NULL default '',
	`eventlog_db_passwd` varchar(255) NOT NULL default '',
	`eventlog_db_host` varchar(255) NOT NULL default '',
	`eventlog_db_name` varchar(255) NOT NULL default '',
	`FK_entities` int(11) NOT NULL default '0',
PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `glpi_plugin_eventlog_config` (`ID`, `eventlog_db_user`, `eventlog_db_passwd`, `eventlog_db_host`, `eventlog_db_name`) VALUES ('1', 'eventlog', 'eventlog', 'localhost', 'eventlog');

DROP TABLE IF EXISTS `glpi_plugin_eventlog_ticket`;
CREATE TABLE `glpi_plugin_eventlog_ticket` (
	`ID` int(11) NOT NULL auto_increment,
	`category` int(11) NOT NULL default '0',
PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `glpi_plugin_eventlog_default`;
CREATE TABLE `glpi_plugin_eventlog_default` (
	`ID` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
	`type` INT( 11 ) NOT NULL 
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `glpi_plugin_eventlog_default` (`ID`, `type`) VALUES ('1', '1');

DROP TABLE IF EXISTS `glpi_plugin_eventlog_profiles`;
CREATE TABLE `glpi_plugin_eventlog_profiles` (
	`ID` int(11) NOT NULL auto_increment,
	`name` varchar(255) default NULL,
	`interface` varchar(50) NOT NULL default 'eventlog',
	`is_default` smallint(6) NOT NULL default '0',
	`eventlog` char(1) default NULL,
	PRIMARY KEY  (`ID`),
	KEY `interface` (`interface`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

DROP TABLE IF EXISTS `glpi_plugin_eventlog_display`;
CREATE TABLE `glpi_plugin_eventlog_display` (
	`ID` int(11) NOT NULL auto_increment,
	`type` smallint(6) NOT NULL default '0',
	`num` smallint(6) NOT NULL default '0',
	`rank` smallint(6) NOT NULL default '0',
	`FK_users` int(11) NOT NULL default '0',
	PRIMARY KEY  (`ID`),
	UNIQUE KEY `type_2` (`type`,`num`,`FK_users`),
	KEY `type` (`type`),
	KEY `rank` (`rank`),
	KEY `num` (`num`),
	KEY `FK_users` (`FK_users`)
) ENGINE=MyISAM AUTO_INCREMENT=122 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO glpi_plugin_eventlog_display VALUES ('1','1','1','1','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('2','1','4','2','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('3','1','3','3','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('4','1','6','4','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('5','1','7','5','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('6','1','5','6','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('7','1','8','7','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('8','1','10','8','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('9','2','1','1','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('10','2','5','2','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('11','2','4','3','0');
INSERT INTO glpi_plugin_eventlog_display VALUES ('12','2','3','4','0');