* remove derby and fyracle from trunk
This commit is contained in:
parent
7b42e73c7a
commit
19d069f326
|
@ -1,8 +0,0 @@
|
|||
lib.dir=../lib
|
||||
schemaoutputfile=../adempiere-model.xml
|
||||
schemafiles=adempiere-model.xml
|
||||
datafile=../adempiere-data.xml
|
||||
sqloutputfile=adempiere-schema.sql
|
||||
fkoutputfile=adempiere-fk.sql
|
||||
alterdatabase=false
|
||||
delimitedsqlidentifiers=true
|
|
@ -1,136 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
<project default="writeSchemaSqlToFile" name="DdlUtils" basedir=".">
|
||||
<!-- Allow values set at the commandline or in the environment to override the defaults -->
|
||||
<property environment="env" />
|
||||
<!-- Load the jdbc properties as specified by the jdbc.properties.file variable-->
|
||||
<property file="jdbc.properties.fyracle" />
|
||||
<!-- Load the build properties -->
|
||||
<property file="build-ddl.properties" />
|
||||
|
||||
<!-- These properties can be overriden on the commandline using -D -->
|
||||
<property name="catalogpattern" value="" />
|
||||
<property name="schemapattern" value="${ddlutils.schema}" />
|
||||
<property name="platform" value="${ddlutils.platform}" />
|
||||
<property name="alterdatabase" value="false" />
|
||||
|
||||
<!-- The classpath used for running the tasks -->
|
||||
<path id="project-classpath">
|
||||
<fileset dir="${lib.dir}">
|
||||
<include name="**/*.jar" />
|
||||
<include name="**/*.zip" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<taskdef classname="org.apache.ddlutils.task.DdlToDatabaseTask" name="ddlToDatabase" classpathref="project-classpath" />
|
||||
<taskdef classname="org.apache.ddlutils.task.DatabaseToDdlTask" name="databaseToDdl" classpathref="project-classpath" />
|
||||
|
||||
<target name="createDb">
|
||||
<ddlToDatabase usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
|
||||
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
|
||||
<createdatabase failonerror="false" />
|
||||
</ddlToDatabase>
|
||||
</target>
|
||||
|
||||
<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="../model">
|
||||
<include name="**/*.xml" />
|
||||
</fileset>
|
||||
|
||||
<writeschematodatabase alterdatabase="${alterdatabase}" dodrops="false" failonerror="false" />
|
||||
</ddlToDatabase>
|
||||
</target>
|
||||
|
||||
<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="../model">
|
||||
<include name="**/*.xml" />
|
||||
</fileset>
|
||||
|
||||
<writeschemasqltofile alterdatabase="${alterdatabase}" dodrops="false" failonerror="false" createtables="true" createforeignkeys="false" outputfile="${sqloutputfile}" />
|
||||
</ddlToDatabase>
|
||||
</target>
|
||||
|
||||
<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="../model">
|
||||
<include name="**/*.xml" />
|
||||
</fileset>
|
||||
|
||||
<writeschemasqltofile alterdatabase="${alterdatabase}" dodrops="false" failonerror="false" createtables="false" createforeignkeys="true" outputfile="${fkoutputfile}" />
|
||||
</ddlToDatabase>
|
||||
</target>
|
||||
|
||||
<target name="writeSchemaToFile">
|
||||
<databaseToDdl usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
|
||||
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
|
||||
<writeSchemaToFile outputfile="${schemaoutputfile}" />
|
||||
</databaseToDdl>
|
||||
</target>
|
||||
|
||||
<target name="writeDataToFile">
|
||||
<databaseToDdl usedelimitedsqlidentifiers="${delimitedsqlidentifiers}" catalogpattern="${catalogpattern}" schemapattern="${schemapattern}" databasetype="${platform}">
|
||||
<database driverclassname="${datasource.driverClassName}" url="${datasource.url}" username="${datasource.username}" password="${datasource.password}" />
|
||||
<writeDataToFile outputfile="${datafile}" />
|
||||
</databaseToDdl>
|
||||
</target>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
|
@ -1,9 +0,0 @@
|
|||
fyracle.home=c:/Program Files/fyracle-0.8.10
|
||||
|
||||
fyracle.database=${basedir}/adempiere.fdb
|
||||
fyracle.user=sysdba
|
||||
fyracle.password=masterkey
|
||||
|
||||
#it can be deployed locally only now
|
||||
fyracle.host=localhost
|
||||
fyracle.port=3050
|
|
@ -1,123 +0,0 @@
|
|||
<project name="export-data" default="create" basedir=".">
|
||||
<property file="build.properties" />
|
||||
<path id="lib.path">
|
||||
<fileset dir="../lib">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml">
|
||||
<classpath>
|
||||
<fileset dir="../lib">
|
||||
<include name="**/*.jar" />
|
||||
</fileset>
|
||||
</classpath>
|
||||
</taskdef>
|
||||
<target name="create" depends="init,create-database,load-init,create-schema,load-data,load-functions,load-others">
|
||||
</target>
|
||||
<target name="init">
|
||||
<echo message="============================================================" />
|
||||
<echo message=" Fyracle database transfer tool for Compiere ERP" />
|
||||
<echo message=" Jotel sp.j. http://www.jotel.com.pl/compiere-port" />
|
||||
<echo message=" Open Business Solutions" />
|
||||
<echo message=" This util license is GNU GPL License" />
|
||||
<echo message=" Adempiere Licese is GNU GPL License" />
|
||||
<echo message="============================================================" />
|
||||
<echo message="" file="log/plsql.log" append="false" />
|
||||
<echo append="false" file="log/build.log" message="#Build log:${line.separator}${line.separator}" />
|
||||
</target>
|
||||
<target name="create-database">
|
||||
<!-- make backup just in case -->
|
||||
<move file="${fyracle.database}" tofile="backup/adempiere.fdb" failonerror="false" />
|
||||
<copy file="template.fdb" tofile="${fyracle.database}" />
|
||||
</target>
|
||||
<target name="load-init">
|
||||
<echo file="log/plsql.log" append="true" message="${line.separator}#Load init.sql:${line.separator}${line.separator}" />
|
||||
<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 -----" />
|
||||
<ant antfile="build-ddl.xml" target="writeSchemaSqlToFile" />
|
||||
<antcall target="load">
|
||||
<param name="file.name" value="${basedir}/adempiere-schema.sql" />
|
||||
</antcall>
|
||||
</target>
|
||||
<target name="load-functions">
|
||||
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Procedures:${line.separator}${line.separator}" />
|
||||
<foreach param="file.name" target="load">
|
||||
<path>
|
||||
<fileset dir="../oracle/procedures">
|
||||
<include name="**" />
|
||||
</fileset>
|
||||
</path>
|
||||
</foreach>
|
||||
</target>
|
||||
<target name="load-data">
|
||||
<echo message="----- Loading Adempiere Seed data -----" />
|
||||
<ant antfile="build-ddl.xml" target="writeDataToDb" />
|
||||
</target>
|
||||
|
||||
<target name="load-others">
|
||||
<echo message="----- Loading other database object -----" />
|
||||
|
||||
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Views [1st Pass]:${line.separator}${line.separator}" />
|
||||
<foreach param="file.name" target="load">
|
||||
<path>
|
||||
<fileset dir="../views">
|
||||
<include name="**" />
|
||||
</fileset>
|
||||
</path>
|
||||
</foreach>
|
||||
|
||||
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Views [2nd Pass]:${line.separator}${line.separator}" />
|
||||
<foreach param="file.name" target="load">
|
||||
<path>
|
||||
<fileset dir="../views">
|
||||
<include name="**" />
|
||||
</fileset>
|
||||
</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>
|
||||
<fileset dir="../sequences">
|
||||
<include name="**" />
|
||||
</fileset>
|
||||
</path>
|
||||
</foreach>
|
||||
|
||||
<ant antfile="build-ddl.xml" target="writeFkSqlToFile" />
|
||||
<echo file="log/plsql.log" append="true" message="${line.separator}#Create Foreign Keys:${line.separator}${line.separator}" />
|
||||
<antcall target="load">
|
||||
<param name="file.name" value="${basedir}/adempiere-fk.sql" />
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="load">
|
||||
<echo message="Loading file ${file.name}" />
|
||||
<exec dir="${fyracle.home}\bin" executable="${fyracle.home}/bin/plsql" resultproperty="plsql.result" output="log/plsql.log" append="true">
|
||||
<arg value="${fyracle.database}" />
|
||||
<arg value="${file.name}" />
|
||||
</exec>
|
||||
<echo message="File ${file.name} status ${plsql.result}" />
|
||||
<echo append="true" file="log/build.log">File ${file.name} status ${plsql.result}</echo>
|
||||
<echo append="true" file="log/build.log" message="${line.separator}" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/** Get Character at Position */
|
||||
CREATE OR REPLACE FUNCTION charAt
|
||||
(
|
||||
p_string VARCHAR2,
|
||||
p_pos NUMBER
|
||||
)
|
||||
RETURN VARCHAR2
|
||||
AS
|
||||
BEGIN
|
||||
RETURN SUBSTR(p_string, p_pos, 1);
|
||||
END;
|
||||
/
|
||||
/** GetDate */
|
||||
CREATE OR REPLACE FUNCTION getdate
|
||||
RETURN DATE
|
||||
AS
|
||||
BEGIN
|
||||
RETURN SysDate;
|
||||
END;
|
||||
/
|
||||
/** First Of DD/DY/MM/Q */
|
||||
CREATE OR REPLACE FUNCTION firstOf
|
||||
(
|
||||
p_date DATE,
|
||||
p_datePart VARCHAR2
|
||||
)
|
||||
RETURN DATE
|
||||
AS
|
||||
BEGIN
|
||||
RETURN TRUNC(p_date, p_datePart);
|
||||
END;
|
||||
/
|
||||
/** Add Number of Days */
|
||||
CREATE OR REPLACE FUNCTION addDays
|
||||
(
|
||||
p_date DATE,
|
||||
p_days NUMBER
|
||||
)
|
||||
RETURN DATE
|
||||
AS
|
||||
BEGIN
|
||||
RETURN TRUNC(p_date) + p_days;
|
||||
END;
|
||||
/
|
||||
CREATE OR REPLACE FUNCTION daysBetween
|
||||
(
|
||||
p_date1 DATE,
|
||||
p_date2 DATE
|
||||
)
|
||||
RETURN NUMBER
|
||||
AS
|
||||
BEGIN
|
||||
RETURN (TRUNC(p_date1) - TRUNC(p_date2));
|
||||
END;
|
||||
/
|
|
@ -1,20 +0,0 @@
|
|||
# JDBC properties for Fyracle
|
||||
# Note: Properties starting with "datasource." will be fed into the datasource instance of the
|
||||
# class configured via the datasource.class property
|
||||
|
||||
# Use this property to choose the Oracle9 platform (instead of the Oracle8 default one)
|
||||
ddlutils.platform=Oracle9
|
||||
|
||||
#
|
||||
# Using the plain DBCP datasource
|
||||
#
|
||||
|
||||
datasource.class=org.apache.commons.dbcp.BasicDataSource
|
||||
datasource.driverClassName=org.firebirdsql.jdbc.FBDriver
|
||||
datasource.url=jdbc:firebirdsql:oracle:localhost/3050:${basedir}/adempiere.fdb
|
||||
datasource.username=sysdba
|
||||
datasource.password=masterkey
|
||||
|
||||
# For oracle, we should limit the schema to the one of the user
|
||||
# Note that Oracle requires this to be uppercase, even when using delimited identifiers
|
||||
ddlutils.schema=ADEMPIERE
|
|
@ -1,2 +0,0 @@
|
|||
Folder to store log generated from build
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
1. Installed ant
|
||||
2. Update build.properties and jdbc.properties.fyracle to suit your environment
|
||||
3. 'ant create' to create the adempiere seed database for fyracle.
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue