From ac5b087ea2d9ba7428d367aaeb288534158fee9a Mon Sep 17 00:00:00 2001
From: christopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>
Date: Fri, 1 Sep 2006 01:16:38 +0000
Subject: Initial Import

git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/ledger-smb@1 4979c152-3d1c-0410-bac9-87ea11338e46
---
 sql/Pg-upgrade-2.3.9-2.4.2.sql | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100755 sql/Pg-upgrade-2.3.9-2.4.2.sql

(limited to 'sql/Pg-upgrade-2.3.9-2.4.2.sql')

diff --git a/sql/Pg-upgrade-2.3.9-2.4.2.sql b/sql/Pg-upgrade-2.3.9-2.4.2.sql
new file mode 100755
index 00000000..4e91e473
--- /dev/null
+++ b/sql/Pg-upgrade-2.3.9-2.4.2.sql
@@ -0,0 +1,34 @@
+--
+drop trigger del_customer on customer;
+drop trigger del_vendor on vendor;
+drop function del_customer();
+drop function del_vendor();
+--
+create function del_customer() returns opaque as '
+begin
+  delete from shipto where trans_id = old.id;
+  delete from customertax where customer_id = old.id;
+  delete from partscustomer where customer_id = old.id;
+  return NULL;
+end;
+' language 'plpgsql';
+-- end function
+--
+create trigger del_customer after delete on customer for each row execute procedure del_customer();
+-- end trigger
+--
+create function del_vendor() returns opaque as '
+begin
+  delete from shipto where trans_id = old.id;
+  delete from vendortax where vendor_id = old.id;
+  delete from partsvendor where vendor_id = old.id;
+  return NULL;
+end;
+' language 'plpgsql';
+-- end function
+-- 
+create trigger del_vendor after delete on vendor for each row execute procedure del_vendor();
+-- end trigger
+--
+update defaults set version = '2.4.2';
+
-- 
cgit v1.2.3

