Skip to content

Commit

Permalink
- Added liquibase DDL to generation schema files for MySQL and Postgres
Browse files Browse the repository at this point in the history
- Updated build accordingly



git-svn-id: http://svn.projects.ez.no/ezxmlexport/trunk@6 32376ed6-4361-46a3-a39a-35035753d010
  • Loading branch information
Jérôme Renard committed Mar 1, 2010
1 parent 7efd570 commit a41af84
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 0 deletions.
1 change: 1 addition & 0 deletions ant/files.to.exclude.txt
@@ -0,0 +1 @@
liquibase/
135 changes: 135 additions & 0 deletions liquibase/createtable.xml
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">

<changeSet id="1" author="">
<createTable tableName="ezxmlexport_available_contentclass_attributes">
<column name="contentclass_attribute_id" type="java.sql.Types.INT">
<constraints unique="true" nullable="false"/>
</column>

<column name="contentclass_id" type="java.sql.Types.INT">
<constraints unique="false" nullable="false"/>
</column>
</createTable>

<createTable tableName="ezxmlexport_available_contentclasses">
<column name="contentclass_id" type="java.sql.Types.INT">
<constraints unique="true" nullable="false"/>
</column>
</createTable>

<createTable tableName="ezxmlexport_customers">
<column autoIncrement="true" name="id" type="java.sql.Types.INT">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="VARCHAR( 200 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="ftp_target" type="java.sql.Types.LONGVARCHAR">
<constraints unique="false" nullable="false"/>
</column>
<column name="slicing_mode" type="enum-1.n">
<constraints unique="false" nullable="false"/>
</column>
</createTable>

<createTable tableName="ezxmlexport_exports">
<column autoIncrement="true" name="id" type="java.sql.Types.INT">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="customer_id" type="java.sql.Types.INT">
<constraints unique="false" nullable="false"/>
</column>
<column name="name" type="VARCHAR( 200 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="description" type="VARCHAR( 200 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="sources" type="java.sql.Types.LONGVARCHAR">
<constraints unique="false" nullable="false"/>
</column>
<column name="ftp_target" type="VARCHAR( 200 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="slicing_mode" type="enum-1.n">
<constraints unique="false" nullable="false"/>
</column>
<column name="start_date" type="VARCHAR( 15 )" defaultValue="0">
<constraints unique="false" nullable="false"/>
</column>
<column name="end_date" type="VARCHAR( 15 )" defaultValue="0">
<constraints unique="false" nullable="false"/>
</column>
<column name="export_schedule" type="VARCHAR( 100 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="export_limit" type="java.sql.Types.INT">
<constraints unique="false" nullable="false"/>
</column>
<column name="export_from_last" type="java.sql.Types.TINYINT" defaultValue="0">
<constraints unique="false" nullable="false"/>
</column>
<column name="compression" type="java.sql.Types.TINYINT">
<constraints unique="false" nullable="false"/>
</column>
<column name="related_object_handling" type="java.sql.Types.TINYINT">
<constraints unique="false" nullable="false"/>
</column>
<column name="xslt_file" type="VARCHAR( 70 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="export_hidden_nodes" type="java.sql.Types.TINYINT" defaultValue="0">
<constraints unique="false" nullable="false"/>
</column>
</createTable>

<createTable tableName="ezxmlexport_process_logs">
<column autoIncrement="true" name="id" type="java.sql.Types.INT">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="export_id" type="java.sql.Types.INT">
<constraints unique="false" nullable="false"/>
</column>
<column name="start_date" type="VARCHAR( 10 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="end_date" type="VARCHAR( 10 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="start_transfert_date" type="VARCHAR( 10 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="end_transfert_date" type="VARCHAR( 10 )">
<constraints unique="false" nullable="false"/>
</column>
<column name="status" type="java.sql.Types.INT">
<constraints unique="false" nullable="false"/>
</column>
</createTable>

<createTable tableName="ezxmlexport_export_object_log">
<column name="process_log_id" type="java.sql.Types.INT">
<constraints nullable="false" foreignKeyName="FK_process_log_id" references="ezxmlexport_process_logs( id ) " deleteCascade="true"/>
</column>
<column name="contentobject_id" type="java.sql.Types.INT">
<constraints unique="false" nullable="false"/>
</column>
</createTable>

<modifySql dbms="mysql">
<replace replace="enum-1.n" with="ENUM( '1', 'n' )"/>
<append value=" ENGINE=InnoDB DEFAULT CHARSET=utf8"/>
</modifySql>

<modifySql dbms="postgresql">
<replace replace="enum-1.n" with="CHAR( 1 ) CHECK( slicing_mode IN ('1', 'n' ))"/>
<replace replace="TINYINT" with="SMALLINT"/>
</modifySql>
</changeSet>
</databaseChangeLog>
18 changes: 18 additions & 0 deletions liquibase/liquibase.properties
@@ -0,0 +1,18 @@
classpath:/opt/local/share/java/mysql-connector-java-5.0.jar:/opt/local/share/java/postgresql.jar
changeLogFile=createtable.xml

#
# Mysql Settings
#
#username=root
#password=publish
#url=jdbc:mysql://localhost/testsliquibase

#
# Postgres driver
#
url=jdbc:postgresql://localhost/postgres
username=postgres
password=1234

logLevel=severe

0 comments on commit a41af84

Please sign in to comment.