1 <package id = "distribution-upgrade-451"
4 descrip = "load PostBooks resources"
7 <prerequisite type = "query"
8 name = "Checking xTuple Edition" >
9 <query>SELECT fetchMetricText('Application') = 'Standard';</query>
10 <message>This package must be applied to a Distribution database.</message>
13 <prerequisite type = "query"
14 name = "Checking xTuple ERP database version" >
15 <query>SELECT fetchMetricText('ServerVersion') > '4.4.';</query>
16 <message>This package must be applied to a 4.4+ Distribution database.
20 <prerequisite type = "query"
21 name = "Checking for bad xTuple ERP database version" >
22 <query>SELECT NOT fetchMetricText('ServerVersion') > '4.5.1' AND fetchMetricText('ServerVersion')!='4.5.0Beta' AND fetchMetricText('ServerVersion')!='4.5.0RC';</query>
23 <message>This package may not be applied to a 4.5.1+ Distribution database.
27 <prerequisite type = "query"
28 name = "Checking for mobile-enabled schemas" >
29 <query>SELECT NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'xm');</query>
30 <message>This package may not be applied to a mobile-enabled database. Please see your system administrator or contact xTuple.
34 <prerequisite type = "query"
35 name = "Checking for xwd schema" >
36 <query>SELECT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'xwd');</query>
37 <message>This package requires that XWD 240 package to be installed before continuing.</message>
40 <prerequisite type = "query"
41 name = "Checking for duplicate Credit Card payments on Sales Orders" >
43 WITH counter AS (SELECT COUNT(*) AS freq
45 GROUP BY payco_ccpay_id, payco_cohead_id
47 SELECT (COALESCE(MAX(freq), 1) = 0 OR COALESCE(MAX(freq), 1) = 1)
50 <message>There are duplicate payco_ccpay_id and payco_cohead_id on the payco table. Please see your system administrator or contact xTuple.
54 <prerequisite type="query" name="Checking xwd Package Version">
55 <query>SELECT TRUE FROM pkghead WHERE pkghead_name = 'xwd' AND (pkghead_version >= '2.4');</query>
56 <message>This package must be applied against the 2.4.0 version of the xwd package.</message>
59 <script file="postbooks_upgrade.sql" />
60 <script file="inventory_upgrade.sql" />
61 <script file="distribution_upgrade.sql" />