-- 创建消息表
drop table if exists lucene$message;
create table lucene$message(
    me_id bigint not null primary key auto_increment,
    me_table_name varchar(64) not null,
    me_method_type varchar(6) not null,
    me_data_id int not null,
    me_data text,
    me_priority int default 0,
    me_retry_count int default 0,
    me_create_time datetime not null
);

-- 创建消息历史表
drop table if exists lucene$message_history;
create table lucene$message_history(
    mh_id bigint not null primary key auto_increment,
    mh_dequeue_time datetime not null,
    me_id bigint not null,
    me_table_name varchar(64) not null,
    me_method_type varchar(6) not null,
    me_data_id int not null,
    me_data text,
    me_priority int default 0,
    me_create_time datetime not null
);

-- 创建存储过程 入队消息
drop procedure if exists enqueue_lucene_message;
delimiter $$
create procedure enqueue_lucene_message(in v_table_name varchar(64), v_method_type varchar(6), v_data_id int, v_data text, v_priority int)
begin
	insert into lucene$message (me_table_name, me_method_type, me_data_id, me_data, me_priority, me_create_time) values(v_table_name, v_method_type, v_data_id, v_data, v_priority, sysdate());
end;$$
delimiter ;

-- 创建存储过程 出队消息
drop procedure if exists dequeue_lucene_message;
delimiter $$
create procedure dequeue_lucene_message(in v_id bigint)
begin
	insert into lucene$message_history (mh_dequeue_time, me_id, me_table_name, me_method_type, me_data_id, me_data, me_priority, me_create_time) select sysdate(), me_id, me_table_name, me_method_type, me_data_id, me_data, me_priority, me_create_time from lucene$message where me_id = v_id;
	delete from lucene$message where me_id = v_id;
end;$$
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$CHANGES
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_changes_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_changes_i` AFTER INSERT ON `PURC$CHANGES` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'PURC$CHANGES';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pc_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$CHANGES
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_changes_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_changes_u` AFTER UPDATE ON `PURC$CHANGES` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'PURC$CHANGES';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pc_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$changes
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_changes_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_changes_d` AFTER DELETE ON `purc$changes` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$changes';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pc_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$forecast
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_forecast_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_forecast_i` AFTER INSERT ON `purc$forecast` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$forecast';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.pf_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$forecast
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_forecast_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_forecast_u` AFTER UPDATE ON `purc$forecast` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$forecast';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pf_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$forecast
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_forecast_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_forecast_d` AFTER DELETE ON `purc$forecast` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$forecast';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pf_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority); 
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$mrb
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_mrb_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_mrb_i` AFTER INSERT ON `purc$mrb` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$mrb';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pm_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$mrb
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_mrb_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_mrb_u` AFTER UPDATE ON `purc$mrb` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$mrb';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pm_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$mrb
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_mrb_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_mrb_d` AFTER DELETE ON `purc$mrb` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$mrb';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pm_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$notice
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_notice_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_notice_i` AFTER INSERT ON `purc$notice` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$notice';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.pn_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$notice
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_notice_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_notice_u` AFTER UPDATE ON `purc$notice` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$notice';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pn_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$notice
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_notice_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_notice_d` AFTER DELETE ON `purc$notice` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$notice';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pn_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$orders
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_orders_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_orders_i` AFTER INSERT ON `purc$orders` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$orders';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.pu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$orders
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_orders_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_orders_u` AFTER UPDATE ON `purc$orders` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$orders';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$orders
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_orders_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_orders_d` AFTER DELETE ON `purc$orders` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$orders';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingapproval
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingapproval_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingapproval_i` AFTER INSERT ON `purc$proofingapproval` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingapproval';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.psa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingapproval
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingapproval_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingapproval_u` AFTER UPDATE ON `purc$proofingapproval` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingapproval';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.psa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingapproval
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingapproval_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingapproval_d` AFTER DELETE ON `purc$proofingapproval` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingapproval';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.psa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingsend
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingsend_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingsend_i` AFTER INSERT ON `purc$proofingsend` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingsend';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.pps_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingsend
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingsend_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingsend_u` AFTER UPDATE ON `purc$proofingsend` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingsend';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pps_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingsend
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingsend_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingsend_d` AFTER DELETE ON `purc$proofingsend` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingsend';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pps_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$return
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_return_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_return_i` AFTER INSERT ON `purc$return` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$return';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.pr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$return
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_return_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_return_u` AFTER UPDATE ON `purc$return` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$return';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$return
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_return_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_return_d` AFTER DELETE ON `purc$return` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$return';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;
-- ----------------------------
-- Triggers structure for table purc$tender
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_tender_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_tender_i` AFTER INSERT ON `purc$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$tender';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.pt_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$tender
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_tender_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_tender_u` AFTER UPDATE ON `purc$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$tender';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pt_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$tender
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_tender_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_tender_d` AFTER DELETE ON `purc$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$tender';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.pt_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$vendors
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_vendors_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_vendors_i` AFTER INSERT ON `purc$vendors` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$vendors';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.ve_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$vendors
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_vendors_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_vendors_u` AFTER UPDATE ON `purc$vendors` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$vendors';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ve_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$vendors
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_vendors_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_vendors_d` AFTER DELETE ON `purc$vendors` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$vendors';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ve_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$vendors_cust
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_vendors_cust_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_vendors_cust_i` AFTER INSERT ON `purc$vendors` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$vendors_cust';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.ve_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$vendors_cust
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_vendors_cust_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_vendors_cust_u` AFTER UPDATE ON `purc$vendors` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$vendors_cust';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ve_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$vendors_cust
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_vendors_cust_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_vendors_cust_d` AFTER DELETE ON `purc$vendors` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$vendors_cust';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ve_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;


-- ----------------------------
-- Triggers structure for table sale$archeck
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_archeck_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_archeck_i` AFTER INSERT ON `sale$archeck` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$archeck';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.sac_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table SALE$ARCHECK
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_archeck_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_archeck_u` AFTER UPDATE ON `sale$archeck` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$archeck';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.sac_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table SALE$ARCHECK
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_archeck_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_archeck_d` AFTER DELETE ON `sale$archeck` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$archeck';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.sac_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;
-- ----------------------------
-- Triggers structure for table sale$quotation
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_quotation_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_quotation_i` AFTER INSERT ON `sale$quotation` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$quotation';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.qu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$quotation
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_quotation_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_quotation_u` AFTER UPDATE ON `sale$quotation` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$quotation';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.qu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$quotation
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_quotation_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_quotation_d` AFTER DELETE ON `sale$quotation` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$quotation';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.qu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$send
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_send_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_send_i` AFTER INSERT ON `sale$send` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$send';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.ss_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$send
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_send_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_send_u` AFTER UPDATE ON `sale$send` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$send';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ss_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$send
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_send_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_send_d` AFTER DELETE ON `sale$send` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$send';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ss_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tender
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_tender_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_tender_i` AFTER INSERT ON `sale$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$tender';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.st_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tender
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_tender_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_tender_u` AFTER UPDATE ON `sale$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$tender';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.st_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tender
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_tender_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_tender_d` AFTER DELETE ON `sale$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$tender';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.st_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tender_b2b
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_tender_b2b_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_tender_b2b_i` AFTER INSERT ON `sale$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$tender_b2b';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.st_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tender_b2b
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_tender_b2b_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_tender_b2b_u` AFTER UPDATE ON `sale$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$tender_b2b';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.st_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tender_b2b
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_sale_tender_b2b_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_sale_tender_b2b_d` AFTER DELETE ON `sale$tender` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'sale$tender_b2b';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.st_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;


-- ----------------------------
-- Triggers structure for table purc$proofingitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingitems_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingitems_i` AFTER INSERT ON `purc$proofingitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingitems';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.ppi_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingitems_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingitems_u` AFTER UPDATE ON `purc$proofingitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingitems';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ppi_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$proofingitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_proofingitems_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_proofingitems_d` AFTER DELETE ON `purc$proofingitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$proofingitems';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.ppi_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table invitationrecords
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_invitationrecords_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_invitationrecords_i` AFTER INSERT ON `invitationrecords` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'invitationrecords';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table invitationrecords
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_invitationrecords_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_invitationrecords_u` AFTER UPDATE ON `invitationrecords` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'invitationrecords';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table invitationrecords
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_invitationrecords_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_invitationrecords_d` AFTER DELETE ON `invitationrecords` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'invitationrecords';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table public$inquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_public_inquiryitems_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_public_inquiryitems_i` AFTER INSERT ON `public$inquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'public$inquiryitems';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table public$inquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_public_inquiryitems_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_public_inquiryitems_u` AFTER UPDATE ON `public$inquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'public$inquiryitems';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table public$inquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_public_inquiryitems_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_public_inquiryitems_d` AFTER DELETE ON `public$inquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'public$inquiryitems';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiry
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquiry_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquiry_i` AFTER INSERT ON `purc$puinquiry` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$puinquiry';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiry
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquiry_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquiry_u` AFTER UPDATE ON `purc$puinquiry` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$puinquiry';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiry
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquiry_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquiry_d` AFTER DELETE ON `purc$puinquiry` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$puinquiry';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_puinquiryitems_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_puinquiryitems_i` AFTER INSERT ON `purc$puinquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$puinquiryitems';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_puinquiryitems_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_puinquiryitems_u` AFTER UPDATE ON `purc$puinquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$puinquiryitems';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_puinquiryitems_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_puinquiryitems_d` AFTER DELETE ON `purc$puinquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$puinquiryitems';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$inquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquiryitems_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquiryitems_i` AFTER INSERT ON `purc$inquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$inquiryitems';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$inquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquiryitems_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquiryitems_u` AFTER UPDATE ON `purc$inquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$inquiryitems';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$inquiryitems
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquiryitems_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquiryitems_d` AFTER DELETE ON `purc$inquiryitems` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$inquiryitems';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.id_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$inquirymould
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquirymould_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquirymould_i` AFTER INSERT ON `purc$inquirymould` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$inquirymould';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.im_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$inquirymould
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquirymould_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquirymould_u` AFTER UPDATE ON `purc$inquirymould` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$inquirymould';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.im_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$inquirymould
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_purc_inquirymould_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_purc_inquirymould_d` AFTER DELETE ON `purc$inquirymould` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'purc$inquirymould';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.im_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table invitationrecords
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_invitationrecords_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_invitationrecords_i` AFTER INSERT ON `invitationrecords` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'invitationrecords';
    declare v_method_type varchar(6) default 'insert';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=new.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table invitationrecords
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_invitationrecords_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_invitationrecords_u` AFTER UPDATE ON `invitationrecords` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'invitationrecords';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table invitationrecords
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_invitationrecords_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_invitationrecords_d` AFTER DELETE ON `invitationrecords` FOR EACH ROW begin
	declare v_table_name varchar(64) default 'invitationrecords';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 0;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;


-- ---hyy---------------------
-- ----------------------------
-- Triggers structure for table sale$tenderquestion
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_tenderquestion_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_tenderquestion_i` AFTER INSERT ON `sale$tenderquestion` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'sale$tenderquestion';
    declare v_method_type varchar(6) default 'delete';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.stq_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tenderquestion
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_tenderquestion_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_tenderquestion_u` AFTER UPDATE ON `sale$tenderquestion` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'sale$tenderquestion';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.stq_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tenderquestion
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_tenderquestion_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_tenderquestion_d` AFTER DELETE ON `sale$tenderquestion` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'sale$tenderquestion';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.stq_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table sale$tenderquestion
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_tenderquestion_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_tenderquestion_d` AFTER DELETE ON `sale$tenderquestion` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'sale$tenderquestion';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.stq_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$DEPUTYORDERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_DEPUTYORDERS_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_DEPUTYORDERS_i` AFTER INSERT ON `PURC$DEPUTYORDERS` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$deputyorders';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.deo_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$DEPUTYORDERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_DEPUTYORDERS_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_DEPUTYORDERS_u` AFTER update ON `PURC$DEPUTYORDERS` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$deputyorders';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.deo_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$DEPUTYORDERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_DEPUTYORDERS_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_DEPUTYORDERS_d` AFTER DELETE ON `PURC$DEPUTYORDERS` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$deputyorders';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.deo_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiry
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_puinquiry_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_puinquiry_d` AFTER DELETE ON `purc$puinquiry` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$puinquiry';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiry
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_puinquiry_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_puinquiry_u` AFTER update ON `purc$puinquiry` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$puinquiry';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table purc$puinquiry
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_puinquiry_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_puinquiry_i` AFTER INSERT ON `purc$puinquiry` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$puinquiry';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.in_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$ACCEPT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_ACCEPT_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_ACCEPT_i` AFTER INSERT ON `MAKE$ACCEPT` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$ACCEPT';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.ma_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$ACCEPT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_ACCEPT_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_ACCEPT_u` AFTER UPDATE ON `MAKE$ACCEPT` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$ACCEPT';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.ma_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$ACCEPT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_ACCEPT_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_ACCEPT_d` AFTER DELETE ON `MAKE$ACCEPT` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$ACCEPT';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.ma_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$ORDERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_ORDERS_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_ORDERS_d` AFTER DELETE ON `MAKE$ORDERS` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$ORDERS';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.ma_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$ORDERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_ORDERS_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_ORDERS_u` AFTER UPDATE ON `MAKE$ORDERS` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$ORDERS';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.ma_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$ORDERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_ORDERS_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_ORDERS_i` AFTER INSERT ON `MAKE$ORDERS` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$ORDERS';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.ma_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$RETURN
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_RETURN_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_RETURN_i` AFTER INSERT ON `MAKE$RETURN` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$RETURN';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.mr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$RETURN
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_RETURN_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_RETURN_u` AFTER UPDATE ON `MAKE$RETURN` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$RETURN';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.mr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$RETURN
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_RETURN_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_RETURN_d` AFTER DELETE ON `MAKE$RETURN` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$RETURN';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.mr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$CHANGEITEMS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_CHANGEITEMS_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_CHANGEITEMS_d` AFTER DELETE ON `MAKE$CHANGEITEMS` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$CHANGEITEMS';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.mcd_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$CHANGEITEMS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_CHANGEITEMS_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_CHANGEITEMS_u` AFTER UPDATE ON `MAKE$CHANGEITEMS` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$CHANGEITEMS';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.mcd_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table MAKE$CHANGEITEMS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_MAKE_CHANGEITEMS_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_MAKE_CHANGEITEMS_i` AFTER INSERT ON `MAKE$CHANGEITEMS` FOR EACH ROW
begin	
    declare v_table_name varchar(64) default 'MAKE$CHANGEITEMS';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.mcd_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$PAGINGRELEASEDETAIL
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_PAGINGRELEASEDETAIL_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_PAGINGRELEASEDETAIL_i` AFTER INSERT ON `PURC$PAGINGRELEASEDETAIL` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$PAGINGRELEASEDETAIL';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.prd_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$PAGINGRELEASEDETAIL
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_PAGINGRELEASEDETAIL_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_PAGINGRELEASEDETAIL_u` AFTER UPDATE ON `PURC$PAGINGRELEASEDETAIL` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$PAGINGRELEASEDETAIL';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.prd_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$PAGINGRELEASEDETAIL
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_PAGINGRELEASEDETAIL_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_PAGINGRELEASEDETAIL_d` AFTER DELETE ON `PURC$PAGINGRELEASEDETAIL` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$PAGINGRELEASEDETAIL';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.prd_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PRODUCT$USERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_USERS_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_USERS_d` AFTER DELETE ON `PRODUCT$USERS` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PRODUCT$USERS';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PRODUCT$USERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_USERS_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_USERS_u` AFTER UPDATE ON `PRODUCT$USERS` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PRODUCT$USERS';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PRODUCT$USERS
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_USERS_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_USERS_i` AFTER INSERT ON `PRODUCT$USERS` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PRODUCT$USERS';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pu_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table products
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_products_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_products_i` AFTER INSERT ON `products` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'v$products';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table products
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_products_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_products_u` AFTER UPDATE ON `products` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'v$products';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table products
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_products_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_products_d` AFTER DELETE ON `products` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'v$products';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pr_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$ACCEPT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_ACCEPT_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_ACCEPT_u` AFTER UPDATE ON `PURC$ACCEPT` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$ACCEPT';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$ACCEPT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_ACCEPT_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_ACCEPT_d` AFTER DELETE ON `PURC$ACCEPT` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$ACCEPT';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$ACCEPT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_ACCEPT_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_ACCEPT_i` AFTER INSERT ON `PURC$ACCEPT` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$ACCEPT';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$APBILL
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_APBILL_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_APBILL_i` AFTER INSERT ON `PURC$APBILL` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$APBILL';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pab_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$APBILL
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_APBILL_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_APBILL_u` AFTER UPDATE ON `PURC$APBILL` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$APBILL';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pab_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$APBILL
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_APBILL_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_APBILL_d` AFTER DELETE ON `PURC$APBILL` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'PURC$APBILL';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pab_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$APCHECK
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_APCHECK_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_APCHECK_d` AFTER DELETE ON `PURC$APCHECK` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$apcheck';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$APCHECK
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_APCHECK_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_APCHECK_u` AFTER update ON `PURC$APCHECK` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$apcheck';
    declare v_method_type varchar(6) default 'update';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$APCHECK
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_APCHECK_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_APCHECK_i` AFTER INSERT ON `PURC$APCHECK` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$apcheck';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pa_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$BADIN
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_BADIN_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_BADIN_i` AFTER INSERT ON `PURC$BADIN` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$badin';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.pb_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$BADIN
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_BADIN_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_BADIN_u` AFTER UPDATE ON `PURC$BADIN` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$badin';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pb_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$BADIN
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_BADIN_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_BADIN_d` AFTER DELETE ON `PURC$BADIN` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$badin';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.pb_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$BADOUT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_BADOUT_d`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_BADOUT_d` AFTER DELETE ON `PURC$BADOUT` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$badout';
    declare v_method_type varchar(6) default 'DELETE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.po_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$BADOUT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_BADOUT_u`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_BADOUT_u` AFTER UPDATE ON `PURC$BADOUT` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$badout';
    declare v_method_type varchar(6) default 'UPDATE';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=old.po_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;

-- ----------------------------
-- Triggers structure for table PURC$BADOUT
-- ----------------------------
DROP TRIGGER IF EXISTS `lucene_BADOUT_i`;
delimiter ;;
CREATE DEFINER = `root`@`%` TRIGGER `lucene_BADOUT_i` AFTER INSERT ON `PURC$BADOUT` FOR EACH ROW 
begin	
    declare v_table_name varchar(64) default 'purc$badout';
    declare v_method_type varchar(6) default 'INSERT';
    declare v_data_id int;
    declare v_data text default null;
    declare v_priority int default 1;
    
    set v_data_id=new.po_id;
    call enqueue_lucene_message(v_table_name, v_method_type, v_data_id, v_data, v_priority);
end
;;
delimiter ;