CREATE TABLE `assistant_action` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_id` varchar(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `config` text NOT NULL,
  `action_class` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `action_id` (`action_id`),
  KEY `title` (`title`)
);

CREATE TABLE `assistant_action_user_group` (
  `action_id` int(11) NOT NULL,
  `user_group_id` int(11) NOT NULL,
  PRIMARY KEY (`user_group_id`,`action_id`)
);

ALTER TABLE assistant_action
ADD column `dependent` tinyint(4),
ADD column `sort` int(10) unsigned NOT NULL DEFAULT 1;

-- #BLOCK#
DELETE FROM script_event_type WHERE mid="p$mid";
INSERT INTO script_event_type (mid, event_id, event_mode, title) VALUES ("p$mid", 'ru.bitel.bgbilling.plugins.assistant.server.event.AssistantActionsListEvent', 0, 'Список доступных действий');
-- #ENDB#
