From 440bb578a4052856894f029f567cf6b9139e4791 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 6 Feb 2018 21:39:13 +0100 Subject: [PATCH] upgrade SQL : issue with trigger on tmp_pcmn --- include/sql/patch/upgrade125.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sql/patch/upgrade125.sql b/include/sql/patch/upgrade125.sql index ac8dbf569..060db9247 100644 --- a/include/sql/patch/upgrade125.sql +++ b/include/sql/patch/upgrade125.sql @@ -13,7 +13,8 @@ ALTER TABLE tmp_pcmn ALTER COLUMN id SET DEFAULT nextval('tmp_pcmn_id_seq'::regc ALTER TABLE tmp_pcmn ADD CONSTRAINT id_ux UNIQUE(id); COMMENT ON COLUMN tmp_pcmn.id IS 'allow to identify the row, it is unique and not null (pseudo pk)'; update tmp_pcmn set id=nextval('tmp_pcmn_id_seq'); - +drop trigger t_tmp_pcm_alphanum_ins_upd on tmp_pcmn ; +drop trigger t_tmp_pcmn_ins on tmp_pcmn ; alter table tmp_pcmn add column pcm_direct_use varchar(1); COMMENT ON COLUMN tmp_pcmn.pcm_direct_use IS 'Value are N or Y , N cannot be used directly , not even through a card'; ALTER TABLE tmp_pcmn ALTER COLUMN pcm_direct_use SET DEFAULT 'Y'; @@ -22,6 +23,9 @@ update tmp_pcmn set pcm_direct_use='N' where length(pcm_val) < 3 and not exists ALTER TABLE tmp_pcmn ALTER COLUMN pcm_direct_use SET NOT NULL; alter table tmp_pcmn add constraint pcm_direct_use_ck check (pcm_direct_use in ('Y','N')); +create trigger t_tmp_pcm_alphanum_ins_upd before insert or update on tmp_pcmn for each row execute procedure comptaproc.tmp_pcmn_alphanum_ins_upd(); +create trigger t_tmp_pcmn_ins before insert on tmp_pcmn for each row execute procedure comptaproc.tmp_pcmn_ins(); + insert into bilan (b_name,b_file_template,b_file_form,b_type) values ('ASBL','document/fr_be/bnb-asbl.rtf','document/fr_be/bnb-asbl.form','RTF'); alter table jnt_letter drop jl_amount_deb;