[POS-commit] r6358 - stoqlib/trunk/data/sql

fabio morbec fabio at async.com.br
Tue Apr 10 12:03:48 BRT 2007


Author: fabio
Date: Tue Apr 10 12:03:48 2007
New Revision: 6358

Modified:
   stoqlib/trunk/data/sql/patch-5.sql

Log:
Fix the SQL patch to delete references in abstract_fiscal_book_entry and broken receving orders

Modified: stoqlib/trunk/data/sql/patch-5.sql
==============================================================================
--- stoqlib/trunk/data/sql/patch-5.sql	(original)
+++ stoqlib/trunk/data/sql/patch-5.sql	Tue Apr 10 12:03:48 2007
@@ -1,4 +1,10 @@
 -- #3297: Remove ReceivingOrder IPaymentGroup implementation
-DROP TABLE receiving_order_adapt_to_payment_group;
+DELETE FROM abstract_fiscal_book_entry WHERE id IN (
+  SELECT abstract_fiscal_book_entry.id
+   FROM abstract_fiscal_book_entry, abstract_payment_group
+  WHERE payment_group_id = abstract_payment_group.id AND
+        abstract_payment_group.child_name = 'ReceivingOrderAdaptToPaymentGroup');
 DELETE FROM abstract_payment_group where child_name = 'ReceivingOrderAdaptToPaymentGroup';
+DELETE from receiving_order WHERE purchase_id IS NULL;
 ALTER TABLE receiving_order ALTER COLUMN purchase_id SET NOT NULL;
+DROP TABLE receiving_order_adapt_to_payment_group;


More information about the POS-commit mailing list