From faf104c601ef45b524397c36419c08323a7a7914 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 1 Dec 2011 00:46:27 +0000 Subject: [PATCH] remove mod_paiement for inexisting ledger --- html/admin/sql/patch/upgrade97.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/admin/sql/patch/upgrade97.sql b/html/admin/sql/patch/upgrade97.sql index 28d268129..f2232ab94 100644 --- a/html/admin/sql/patch/upgrade97.sql +++ b/html/admin/sql/patch/upgrade97.sql @@ -792,6 +792,8 @@ update mod_payment set jrn_def_id=3 where mp_type='ACH'; alter table mod_payment drop mp_type; +delete from mod_payment where jrn_def_id not in (select jrn_def_id from jrn_def); + alter table mod_payment add constraint mod_payment_jrn_def_id_fk foreign key (jrn_def_id) references jrn_def(jrn_def_id) on delete cascade on update cascade; comment on column mod_payment.jrn_def_id is 'Ledger using this payment method';