Bug fix [0000191]. Added code_revision column, modified targets to insert a record on database creation
authorIván Perdomo <ivan.perdomo@openbravo.com>
Tue, 06 May 2008 07:14:07 +0000
changeset 812 cdac95bc56e3
parent 811 41830f75f3cd
child 813 77ea42ac1658
Bug fix [0000191]. Added code_revision column, modified targets to insert a record on database creation
build.xml
src-db/database/build.xml
src-db/database/model/tables/AD_SYSTEM_INFO.xml
--- a/build.xml	Tue May 06 00:15:41 2008 +0000
+++ b/build.xml	Tue May 06 07:14:07 2008 +0000
@@ -122,11 +122,25 @@
       <include name="openbravo-wad.jar"/>
     </fileset>
   </path>
-
+  
   <target name="init">
     <fail if="no.java.home" message="The environment variable JAVA_HOME is not set."/>
   </target>
 
+ 
+ <target name="code.rev">
+  <loadfile property="svn.entries" srcFile=".svn/entries" failonerror="false">
+    <filterchain>
+      <filterreader classname="org.apache.tools.ant.filters.HeadFilter">
+        <param name="skip" value="3"/>
+        <param name="lines" value="1"/>
+      </filterreader>
+    </filterchain>
+  </loadfile>
+  <property name="code.revision" value="${svn.entries}" />
+ </target>
+
+
   <target name="compile.complete" depends="init">
     <ant dir="${base.src}" target="compile.complete" inheritAll="true" inheritRefs="true"/>
   </target>
@@ -248,7 +262,7 @@
     <antcall target="compile.complete"/>
   </target>
 
-  <target name="create.database" depends="init">
+  <target name="create.database" depends="init,code.rev">
     <antcall target="database.lib"/>
     <ant dir="${base.db}" target="create.database" inheritAll="true" inheritRefs="true"/>
   </target>
--- a/src-db/database/build.xml	Tue May 06 00:15:41 2008 +0000
+++ b/src-db/database/build.xml	Tue May 06 07:14:07 2008 +0000
@@ -444,6 +444,9 @@
           DELETE FROM AD_SYSTEM;
           INSERT INTO AD_SYSTEM (AD_SYSTEM_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, TAD_RECORDRANGE, TAD_RECORDRANGE_INFO, TAD_LEVEL, TAD_PARENT_VERSION, TAD_TRANSACTIONALRANGE, TAD_THEME)
           VALUES (0, 0, 0, 'Y', NOW(), 0, NOW(), 0, '?', 20, 100, ${development.environment.id}, '$Rev$', 1, 'Default');
+          DELETE FROM AD_SYSTEM_INFO;
+          INSERT INTO AD_SYSTEM_INFO(AD_SYSTEM_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, POSTPONE_DATE, ANT_VERSION, OB_VERSION, OB_INSTALLMODE, CODE_REVISION)
+          VALUES(0, 0, 0, 'Y', NOW(), 0, NOW(), 0, NOW(), '${ant.version}', '${application.version}', 'From Sources', ${code.revision} );
           CALL AD_UPDATE_SEQUENCE();
           CALL AD_UPDATE_ACCESS();
         </transaction>
@@ -467,6 +470,9 @@
           DELETE FROM AD_SYSTEM;
           INSERT INTO AD_SYSTEM (AD_SYSTEM_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, TAD_RECORDRANGE, TAD_RECORDRANGE_INFO, TAD_LEVEL, TAD_PARENT_VERSION, TAD_TRANSACTIONALRANGE, TAD_THEME)
           VALUES (0, 0, 0, 'Y', NOW(), 0, NOW(), 0, '?', 20, 100, ${development.environment.id}, '$Rev$', 1, 'Default');
+          DELETE FROM AD_SYSTEM_INFO;
+          INSERT INTO AD_SYSTEM_INFO(AD_SYSTEM_INFO_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, POSTPONE_DATE, ANT_VERSION, OB_VERSION, OB_INSTALLMODE, CODE_REVISION)
+          VALUES(0, 0, 0, 'Y', NOW(), 0, NOW(), 0, NOW(), '${ant.version}', '${application.version}', 'From Sources', ${code.revision});
           SELECT AD_UPDATE_SEQUENCE();
           SELECT AD_UPDATE_ACCESS();
         </transaction>
--- a/src-db/database/model/tables/AD_SYSTEM_INFO.xml	Tue May 06 00:15:41 2008 +0000
+++ b/src-db/database/model/tables/AD_SYSTEM_INFO.xml	Tue May 06 07:14:07 2008 +0000
@@ -45,7 +45,7 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="ISPROXYREQUIRED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+      <column name="ISPROXYREQUIRED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
         <default><![CDATA[N]]></default>
         <onCreateDefault/>
       </column>
@@ -57,11 +57,11 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="TESTPROXY" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+      <column name="TESTPROXY" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
         <default><![CDATA[Y]]></default>
         <onCreateDefault/>
       </column>
-      <column name="ANT_VERSION" primaryKey="false" required="false" type="NVARCHAR" size="20" autoIncrement="false">
+      <column name="ANT_VERSION" primaryKey="false" required="false" type="NVARCHAR" size="60" autoIncrement="false">
         <default/>
         <onCreateDefault/>
       </column>
@@ -73,6 +73,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="CODE_REVISION" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false">
+        <default><![CDATA[0]]></default>
+        <onCreateDefault/>
+      </column>
       <column name="SERVLET_CONTAINER" primaryKey="false" required="false" type="NVARCHAR" size="20" autoIncrement="false">
         <default/>
         <onCreateDefault/>