* split model by table

* split seed data by table
* updated with 3.1.3 changes
This commit is contained in:
Heng Sin Low 2006-12-28 09:17:57 +00:00
parent 341f959711
commit d34a819c32
3 changed files with 36 additions and 10 deletions

View File

@ -53,8 +53,8 @@
<target name="writeSchemaToDb">
<ddlToDatabase validatexml="false" usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
<fileset dir="..">
<include name="${schemafiles}" />
<fileset dir="../model">
<include name="**/*.xml" />
</fileset>
<writeschematodatabase alterdatabase="${alterdatabase}" dodrops="true" failonerror="false" />
@ -64,8 +64,8 @@
<target name="writeSchemaSqlToFile">
<ddlToDatabase validatexml="false" usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
<fileset dir="..">
<include name="${schemafiles}" />
<fileset dir="../model">
<include name="**/*.xml" />
</fileset>
<writeschemasqltofile alterdatabase="${alterdatabase}" dodrops="false" failonerror="false" createtables="true" createforeignkeys="false" outputfile="${sqloutputfile}" />
@ -75,8 +75,8 @@
<target name="writeFkSqlToFile">
<ddlToDatabase validatexml="false" usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
<fileset dir="..">
<include name="${schemafiles}" />
<fileset dir="../model">
<include name="**/*.xml" />
</fileset>
<writeschemasqltofile alterdatabase="${alterdatabase}" dodrops="false" failonerror="false" createtables="false" createforeignkeys="true" outputfile="${fkoutputfile}" />
@ -99,13 +99,39 @@
<target name="writeDataToDb">
<ddlToDatabase usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
<fileset dir="../model">
<include name="**/*.xml" />
</fileset>
<writedatatodatabase usebatchmode="true" batchSize="20" ensureForeignKeyOrder="false" >
<fileset dir="../data">
<include name="**/*.xml" />
</fileset>
</writedatatodatabase>
</ddlToDatabase>
</target>
<target name="splitSchemaFileByTable">
<ddlToDatabase usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
<fileset dir="..">
<include name="${schemafiles}" />
</fileset>
<writedatatodatabase datafile="${datafile}" usebatchmode="true" batchSize="20" ensureForeignKeyOrder="false" />
<splitSchemaFileByTable destination="../model"/>
</ddlToDatabase>
</target>
<target name="splitDataFileByTable">
<ddlToDatabase usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
<fileset dir="../model">
<include name="**/*.xml" />
</fileset>
<splitDataFileByTable destination="../data" datafile="${datafile}"/>
</ddlToDatabase>
</target>
</project>

View File

@ -36,9 +36,7 @@
</target>
<target name="load-data">
<echo message="----- Loading Adempiere Seed data -----" />
<unjar src="../adempiere-data.jar" dest=".." />
<ant antfile="build-ddl.xml" target="writeDataToDb" />
<delete file="../adempiere-data.xml" />
</target>
<target name="load-functions">

View File

@ -32,3 +32,5 @@ datasource.password=adempiere1
#datasource.dataSourceName=pooling datasource
#datasource.initialConnections=5
#datasource.maxConnections=20
ddlutils.schema=adempiere