* split model by table

* split seed data by table
* sync with 3.1.3 changes
This commit is contained in:
Heng Sin Low 2006-12-28 09:27:55 +00:00
parent bf0dc74d3f
commit bb98109321
3 changed files with 46 additions and 42 deletions

View File

@ -52,8 +52,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="false" failonerror="false" />
@ -63,8 +63,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}" />
@ -74,8 +74,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}" />
@ -98,13 +98,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="false" 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="false" 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

@ -35,6 +35,9 @@
<antcall target="load">
<param name="file.name" value="${basedir}/init.sql" />
</antcall>
<antcall target="load">
<param name="file.name" value="../oracle/functions-decl.sql" />
</antcall>
</target>
<target name="create-schema">
<echo message="----- Creating tables -----" />
@ -44,14 +47,6 @@
</antcall>
</target>
<target name="load-functions">
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Functions:${line.separator}${line.separator}" />
<foreach param="file.name" target="load">
<path>
<fileset dir="../oracle/functions">
<include name="**" />
</fileset>
</path>
</foreach>
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Procedures:${line.separator}${line.separator}" />
<foreach param="file.name" target="load">
<path>
@ -63,17 +58,11 @@
</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-others">
<echo message="----- Loading other database object -----" />
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Temporary Tables:${line.separator}${line.separator}" />
<antcall target="load">
<param name="file.name" value="${basedir}/temptables.sql" />
</antcall>
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Views [1st Pass]:${line.separator}${line.separator}" />
<foreach param="file.name" target="load">
@ -93,6 +82,15 @@
</path>
</foreach>
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Functions:${line.separator}${line.separator}" />
<foreach param="file.name" target="load">
<path>
<fileset dir="../oracle/functions">
<include name="**" />
</fileset>
</path>
</foreach>
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Sequences:${line.separator}${line.separator}" />
<foreach param="file.name" target="load">
<path>

View File

@ -1,20 +0,0 @@
DROP TABLE T_Selection CASCADE CONSTRAINTS;
CREATE GLOBAL TEMPORARY TABLE T_Selection
(
T_Selection_ID NUMBER(10, 0) NOT NULL
CONSTRAINT T_Selection_Key PRIMARY KEY
)
ON COMMIT DELETE ROWS;
DROP TABLE T_Selection2;
CREATE GLOBAL TEMPORARY TABLE T_Selection2
(
Query_ID NUMBER NOT NULL,
T_Selection_ID NUMBER(10) NOT NULL,
CONSTRAINT T_Selection2_Key PRIMARY KEY (Query_ID,T_Selection_ID)
)
ON COMMIT PRESERVE ROWS;