check to see if xm schema exists, if so, disallow upgrade
[xtuple] / scripts / xml / postbooks_package.xml
1 <package id        = "postbooks-upgrade-450"
2          version   = "4.5.0"
3          developer = "xTuple"
4          descrip   = "load PostBooks resources"
5          updater   = "2.2.4" >
6
7   <prerequisite type = "query"
8                 name = "Checking xTuple Edition" >
9     <query>SELECT fetchMetricText('Application') = 'PostBooks';</query>
10     <message>This package must be applied to a PostBooks database.</message>
11   </prerequisite>
12
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+ PostBooks database.
17     </message>
18   </prerequisite>
19
20  <prerequisite type = "query"
21                name = "Checking for bad xTuple ERP database version" >
22     <query>SELECT fetchMetricText('ServerVersion') &lt; '4.5.0';</query>
23     <message>This package may not be applied to a 4.5+ Postbooks database.
24     </message>
25   </prerequisite>
26
27  <prerequisite type = "query"
28                name = "Checking for mobile-enabled schemas" >
29     <query>SELECT TRUE 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.
31     </message>
32   </prerequisite>
33
34   <script file="postbooks_upgrade.sql" />
35
36 </package>