Fixed problem with PostgreSQL prescript
authorAntonio Moreno <antonio.moreno@openbravo.com>
Mon, 23 Jun 2008 17:03:36 +0000
changeset 1335 4bb7d3b71cc6
parent 1334 4346ab2a2659
child 1336 4a2d10dd3fbd
Fixed problem with PostgreSQL prescript
build.xml
src-db/database/build.xml
src-db/database/lib/dbsourcemanager.jar
--- a/build.xml	Mon Jun 23 15:29:25 2008 +0000
+++ b/build.xml	Mon Jun 23 17:03:36 2008 +0000
@@ -274,11 +274,21 @@
     <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
   </target>
 
+  <target name="create.original.database" depends="init,code.rev">
+    <antcall target="database.lib"/>
+    <ant dir="${base.db}" target="create.original.database" inheritAll="true" inheritRefs="true"/>
+  </target>
+
   <target name="update.database" depends="init,code.rev">
     <antcall target="database.lib"/>
     <ant dir="${base.db}" target="update.database" inheritAll="true" inheritRefs="true"/>
   </target>
 
+  <target name="update.customized.database" depends="init,code.rev">
+    <antcall target="database.lib"/>
+    <ant dir="${base.db}" target="update.customized.database" inheritAll="true" inheritRefs="true"/>
+  </target>
+
   <target name="create.database.structure" depends="init">
     <ant dir="${base.db}" target="create.database.structure" inheritAll="true" inheritRefs="true"/>
   </target>
@@ -337,4 +347,8 @@
     <ant dir="${base.db}" target="compare.database.structure" inheritAll="true" inheritRefs="true"/>
   </target>
 
+  <target name="compare.database.data" depends="init">
+    <ant dir="${base.db}" target="compare.database.data" inheritAll="true" inheritRefs="true"/>
+  </target>
+
 </project>
--- a/src-db/database/build.xml	Mon Jun 23 15:29:25 2008 +0000
+++ b/src-db/database/build.xml	Mon Jun 23 17:03:36 2008 +0000
@@ -73,6 +73,10 @@
 	       classname="org.openbravo.ddlutils.task.AlterDatabaseData">
 	<classpath refid="runtime-classpath" />
   </taskdef>
+  <taskdef name="altercustomizeddatabasedata"
+	       classname="org.openbravo.ddlutils.task.AlterCustomizedDatabaseData">
+	<classpath refid="runtime-classpath" />
+  </taskdef>
   <taskdef name="alterscript"
            classname="org.openbravo.ddlutils.task.AlterXML2SQL">
     <classpath refid="runtime-classpath" />
@@ -97,6 +101,10 @@
            classname="org.openbravo.ddlutils.task.CompareDatabase">
     <classpath refid="runtime-classpath" />
   </taskdef>
+  <taskdef name="comparedata"
+	       classname="org.openbravo.ddlutils.task.CompareData">
+	<classpath refid="runtime-classpath" />
+  </taskdef>
 
   <target name="create.database">
     <antcall target="clean.database.${bbdd.rdbms}"/>
@@ -115,6 +123,24 @@
     <antcall target="database.postcreate.${bbdd.rdbms}" />
   </target>
 
+
+  <target name="create.original.database">
+    <antcall target="clean.database.${bbdd.rdbms}"/>
+    <antcall target="prepare.database"/>
+    <antcall target="create.original.database.structure"/>
+    <antcall target="database.preimport.${bbdd.rdbms}" />
+    <importdata driver="${bbdd.driver}"
+                url="${bbdd.owner.url}"
+                user="${bbdd.user}"
+                filter="com.openbravo.db.OpenbravoMetadataFilter"   
+                password="${bbdd.password}"
+                excludeobjects="com.openbravo.db.OpenbravoExcludeFilter"
+                input="${basedir}/../originalDatabase/sourcedata,${basedir}/../originalDatabase/masterdata,${basedir}/../originalDatabase/sampledata"
+                verbosity="${bbdd.verbosity}" />
+    <antcall target="database.postimport.${bbdd.rdbms}" />
+    <antcall target="database.postcreate.${bbdd.rdbms}" />
+  </target>
+
     <target name="update.database">
         <alterdatabasedata driver="${bbdd.driver}"
                        url="${bbdd.owner.url}"
@@ -311,6 +337,19 @@
                         failonerror="false"
                         verbosity="${bbdd.verbosity}" />
         <antcall target="database.poststructure.${bbdd.rdbms}" />
+    </target> 
+
+    <target name="create.original.database.structure">
+        <createdatabase driver="${bbdd.driver}"
+                        url="${bbdd.owner.url}"
+                        user="${bbdd.user}"
+                        password="${bbdd.password}"
+                        model="../originalDatabase/model"
+                        object="${bbdd.object}"
+                        dropfirst="false"
+                        failonerror="false"
+                        verbosity="${bbdd.verbosity}" />
+        <antcall target="database.poststructure.${bbdd.rdbms}" />
     </target>
 
     <target name="update.database.structure">
@@ -515,6 +554,33 @@
                         verbosity="${bbdd.verbosity}" />
     </target>
 
+    <target name="compare.database.data">
+        <comparedata driver="${bbdd.driver}"
+                        url="${bbdd.owner.url}"
+                        user="${bbdd.user}"
+            			excludeobjects="com.openbravo.db.OpenbravoExcludeFilter"
+                        password="${bbdd.password}"
+            			filter="com.openbravo.db.OpenbravoMetadataFilter"   
+                        model="model"
+			            data="${basedir}/sourcedata"
+                        verbosity="${bbdd.verbosity}" />
+    </target>
+
+
+    <target name="update.customized.database">
+        <altercustomizeddatabasedata driver="${bbdd.driver}"
+                        url="${bbdd.owner.url}"
+                        user="${bbdd.user}"
+            			excludeobjects="com.openbravo.db.OpenbravoExcludeFilter"
+                        password="${bbdd.password}"
+            			filter="com.openbravo.db.OpenbravoMetadataFilter"   
+                        model="model" 
+        				orgModel="../originalDatabase/model"
+			            data="${basedir}/sourcedata"
+			            orgData="${basedir}/../originalDatabase/sourcedata"
+                        verbosity="${bbdd.verbosity}" />
+    </target>
+	
   <target name="database.preimport.ORACLE">
   </target>
   <target name="database.postimport.ORACLE">
Binary file src-db/database/lib/dbsourcemanager.jar has changed