omfgppc - 2009-02-27

You have subscribed to a wiki page or wiki category on "xTuple" for change =
notification.

The "320to321.gz" page has been changed by reddog:

  The errors are prerequisites indicating orphaned records where none shoul=
d be. This applies only to the Manufacturing Edition of the software. When =
running these queries please make sure to use caution since you will be man=
ipulating data directly on the database.
  =

  {{{
- SELECT * FROM planoper WHERE planoper_id IN (SELECT planoper_id FROM plan=
oper LEFT OUTER JOIN planord ON (planoper_planord_id=3Dplanord_id));
+ SELECT * FROM planoper LEFT OUTER JOIN planord ON (planoper_planord_id=3D=
planord_id) WHERE (planord_id IS NULL);
  }}}
   . The following query can be used to remove orphaned planned operation r=
ecords:
  =

  {{{
  BEGIN;
- DELETE FROM planoper WHERE planoper_id IN (SELECT planoper_id FROM planop=
er LEFT OUTER JOIN planord ON (planoper_planord_id=3Dplanord_id));
+ DELETE FROM planoper WHERE planoper_id IN (SELECT planoper_id FROM planop=
er LEFT OUTER JOIN planord ON (planoper_planord_id=3Dplanord_id) WHERE (pla=
nord_id IS NULL));
  =

  COMMIT; -- If rows affected match rows SELECTed.
  }}}
@@ -25, +25 @@

  To see the records, use the following SELECT statement.
  =

  {{{
- SELECT * FROM planreq WHERE planreq_id IN (SELECT planreq_id FROM planreq=
LEFT OUTER JOIN planord ON (planreq_source_id=3Dplanord_id));
+ SELECT * FROM planreq LEFT OUTER JOIN planord ON (planreq_source_id=3Dpla=
nord_id) WHERE (planord_id IS NULL);
  }}}
   . The following query can be used to remove orphaned planned requirement=
records:
  =

  {{{
  BEGIN;
- DELETE FROM planreq WHERE planreq_id IN (SELECT planreq_id FROM planreq L=
EFT OUTER JOIN planord ON (planreq_source_id=3Dplanord_id));
+ DELETE FROM planreq WHERE planreq_id IN (SELECT planreq_id FROM planreq L=
EFT OUTER JOIN planord ON (planreq_source_id=3Dplanord_id) WHERE (planord_i=
d IS NULL));
  =

  COMMIT; -- If rows affected match rows SELECTed.
  }}}