/* on SQL node 1 */ create table CALC_FEE ( ID_CALC_FEE bigint not null AUTO_INCREMENT, ID_CALC_FEE_JOB_ID bigint, ID_FEE_SET int, PROCESS varchar(10), FLAG_OBJECT varchar(10), ID_OBJECT int, COST_UNIT_TO varchar(10), COST_UNIT_FROM varchar(10), FEE numeric(19,6), CURRENCY char(3), FEEKEY varchar(10), RATE_VAT numeric(9,2), VAT_INCLUDED char(1), ACCOUNT_END_CUSTOMER varchar(18), FREETEXT varchar(255), DATE_INSERT datetime, AUSPRAEGUNG_AGGREGATION_ID numeric(10), FLAG_CANCELLATION char(1), ID_PARTNER int, ID_SAE int, FLAG_MANUALLY char(1), CDATE_BOOKED varchar(23), CDATE_CANCELLATION_BOOKED varchar(23), DATE_UPDATE datetime, RATE_FX numeric(19,6), FEE_ACCOUNT numeric(19,6), RATE_FX_ACCOUNT numeric(19,6), CURRENCY_ACCOUNT char(3), FEE_PM numeric(19,6), CURRENCY_PM char(3), AMOUNT_VAT numeric(19,6), VALUTA datetime, BOOKINGTEXT varchar(255), ID_CALC_FEE_NEW bigint, primary key (ID_CALC_FEE) ) engine = NDBCLUSTER; /* on all SQL nodes */ delimiter // drop trigger if exists `TR_CALC_FEE_AFTER_INSERT`; // CREATE DEFINER=CURRENT_USER trigger TR_CALC_FEE_AFTER_INSERT AFTER INSERT on CALC_FEE FOR EACH ROW BEGIN /* do something in this trigger */ END; // delimiter; /* on SQL node 1 */ alter table CALC_FEE modify ID_FEE_SET bigint null, modify ID_OBJECT bigint null, modify ID_SAE bigint null; /* check trigger on all SQL nodes */