DROP TABLE IF EXISTS `plugin_log`;
CREATE TABLE IF NOT EXISTS `plugin_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `filename` varchar(255) DEFAULT NULL,
  `function` varchar(255) DEFAULT NULL,
  `value` text,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `plugin_log_config`;
CREATE TABLE IF NOT EXISTS `plugin_log_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `filename` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

INSERT INTO `fields` (`id`, `key`, `type`, `label`, `source`, `modified`) VALUES
(NULL, 'plugin_log_menu_log', 'backend', 'Log plugin / Menu Log', 'plugin', NULL);

SET @id := (SELECT LAST_INSERT_ID());

INSERT INTO `multi_lang` (`id`, `foreign_id`, `model`, `locale`, `field`, `content`, `source`) VALUES
(NULL, @id, 'pjField', 1, 'title', 'Log', 'plugin'),
(NULL, @id, 'pjField', 2, 'title', 'Log', 'plugin'),
(NULL, @id, 'pjField', 3, 'title', 'Log', 'plugin');

INSERT INTO `fields` (`id`, `key`, `type`, `label`, `source`, `modified`) VALUES
(NULL, 'plugin_log_menu_config', 'backend', 'Log plugin / Menu Config', 'plugin', NULL);

SET @id := (SELECT LAST_INSERT_ID());

INSERT INTO `multi_lang` (`id`, `foreign_id`, `model`, `locale`, `field`, `content`, `source`) VALUES
(NULL, @id, 'pjField', 1, 'title', 'Config log', 'plugin'),
(NULL, @id, 'pjField', 2, 'title', 'Config log', 'plugin'),
(NULL, @id, 'pjField', 3, 'title', 'Config log', 'plugin');

INSERT INTO `fields` (`id`, `key`, `type`, `label`, `source`, `modified`) VALUES
(NULL, 'plugin_log_btn_empty', 'backend', 'Log plugin / Empty button', 'plugin', NULL);

SET @id := (SELECT LAST_INSERT_ID());

INSERT INTO `multi_lang` (`id`, `foreign_id`, `model`, `locale`, `field`, `content`, `source`) VALUES
(NULL, @id, 'pjField', 1, 'title', 'Empty log', 'plugin'),
(NULL, @id, 'pjField', 2, 'title', 'Empty log', 'plugin'),
(NULL, @id, 'pjField', 3, 'title', 'Empty log', 'plugin');

INSERT INTO `fields` (`id`, `key`, `type`, `label`, `source`, `modified`) VALUES
(NULL, 'error_titles_ARRAY_PLG01', 'arrays', 'error_titles_ARRAY_PLG01', 'plugin', NULL);

SET @id := (SELECT LAST_INSERT_ID());

INSERT INTO `multi_lang` (`id`, `foreign_id`, `model`, `locale`, `field`, `content`, `source`) VALUES
(NULL, @id, 'pjField', 1, 'title', 'Config log updated.', 'plugin'),
(NULL, @id, 'pjField', 2, 'title', 'Config log updated.', 'plugin'),
(NULL, @id, 'pjField', 3, 'title', 'Config log updated.', 'plugin');

INSERT INTO `fields` (`id`, `key`, `type`, `label`, `source`, `modified`) VALUES
(NULL, 'error_bodies_ARRAY_PLG01', 'arrays', 'error_bodies_ARRAY_PLG01', 'plugin', NULL);

SET @id := (SELECT LAST_INSERT_ID());

INSERT INTO `multi_lang` (`id`, `foreign_id`, `model`, `locale`, `field`, `content`, `source`) VALUES
(NULL, @id, 'pjField', 1, 'title', 'The config log have been updated.', 'plugin'),
(NULL, @id, 'pjField', 2, 'title', 'The config log have been updated.', 'plugin'),
(NULL, @id, 'pjField', 3, 'title', 'The config log have been updated.', 'plugin');