From: Ben Thompson Date: Wed, 18 Jun 2014 23:20:05 +0000 (-0400) Subject: Add prerequisite check for duplicate payco_ccpay_id and payco_cohead_id on the payco... X-Git-Tag: v4.5.0-r1590-3~1^2~8^2~10 X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=86043d8f6c9401eb46c40d4215347721fe60a34d;p=xtuple Add prerequisite check for duplicate payco_ccpay_id and payco_cohead_id on the payco table. --- diff --git a/scripts/xml/distribution_install.xml b/scripts/xml/distribution_install.xml index 3b48d7b4a..d144d1317 100644 --- a/scripts/xml/distribution_install.xml +++ b/scripts/xml/distribution_install.xml @@ -17,20 +17,34 @@ - -SELECT NOT fetchMetricText('ServerVersion') > '4.5.0' AND fetchMetricText('ServerVersion')!='4.5.0Beta' AND fetchMetricText('ServerVersion')!='4.5.0RC'; + + SELECT NOT fetchMetricText('ServerVersion') > '4.5.0' AND fetchMetricText('ServerVersion')!='4.5.0Beta' AND fetchMetricText('ServerVersion')!='4.5.0RC'; This package may not be applied to a 4.5+ PostBooks database. - SELECT NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'xm'); This package may not be applied to a mobile-enabled database. Please see your system administrator or contact xTuple. + + + WITH counter AS (SELECT COUNT(*) AS freq + FROM payco + GROUP BY payco_ccpay_id, payco_cohead_id + ORDER BY 1) + SELECT COALESCE(MAX(freq), 1) <= 1 + FROM counter; + + There are duplicate payco_ccpay_id and payco_cohead_id on the payco table. Please see your system administrator or contact xTuple. + + +