Fixed issue 9931. Apply.modules (or update.database) should no longer fail on fresh installations, or installations in which modules have been installed in a normal way.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 30 Sep 2009 21:15:09 +0200
changeset 5185 96d6af653344
parent 5184 efa13b735b87
child 5186 967465d91318
Fixed issue 9931. Apply.modules (or update.database) should no longer fail on fresh installations, or installations in which modules have been installed in a normal way.
src-db/database/build.xml
src-db/database/model/prescript-PostgreSql.sql
--- a/src-db/database/build.xml	Tue Sep 29 19:41:46 2009 +0200
+++ b/src-db/database/build.xml	Wed Sep 30 21:15:09 2009 +0200
@@ -127,7 +127,35 @@
     <antcall target="update.dbupdate.timestamp" />
   </target>
 
+  <target name="fix.date.ORACLE">
+    <sql driver="${bbdd.driver}" url="${bbdd.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue">
+      <classpath>
+        <fileset dir="${base.lib}">
+          <include name="**/*.jar">
+          </include>
+        </fileset>
+      </classpath>
+      <transaction>
+      </transaction>
+    </sql>
+  </target>
+  <target name="fix.date.POSTGRE">
+    <sql driver="${bbdd.driver}" url="${bbdd.owner.url}" userid="${bbdd.user}" password="${bbdd.password}" onerror="continue" autocommit="true">
+          <classpath>
+            <fileset dir="${base.lib}">
+              <include name="**/*.jar">
+              </include>
+            </fileset>
+          </classpath>
+          <transaction>
+        UPDATE ad_system_info SET last_dbupdate=now()
+        </transaction>
+      </sql>
+    </target>
+  
+  
   <target name="update.database.java">
+    <antcall target="fix.date.${bbdd.rdbms}" />
     <java classname="org.openbravo.ddlutils.task.AlterDatabaseJava" failonerror="true" fork="true" maxmemory="${build.maxmemory}">
       <arg value="${bbdd.driver}"/>
       <arg value="${bbdd.owner.url}"/>
--- a/src-db/database/model/prescript-PostgreSql.sql	Tue Sep 29 19:41:46 2009 +0200
+++ b/src-db/database/model/prescript-PostgreSql.sql	Wed Sep 30 21:15:09 2009 +0200
@@ -1464,7 +1464,7 @@
                   ELSE NULL::integer
               END),'.')||
               COALESCE(TO_CHAR(CASE PG_TYPE.TYPNAME
-                  WHEN 'bytea'::nameDB_CHECKSUM  THEN 4000
+                  WHEN 'bytea'::name  THEN 4000
                   WHEN 'text'::name THEN 4000
                   WHEN 'oid'::name THEN 4000
                   ELSE CASE PG_ATTRIBUTE.ATTLEN