Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Create another database from changelog: automatic data type conversion issue

$
0
0
I get the changelog from PostgreSQL database with the command:

  1. liquibase \
  2.    --driver=org.postgresql.Driver \
  3.    --classpath="C:\db_drivers\postgresql-9.3-1102.jdbc3.jar" \
  4.    --changeLogFile="./postgresql_changelog.xml" \
  5.    --url="jdbc:postgresql://localhost:5432/postgres" \
  6.    --username=schema_name_here \
  7.    --password=************** \
  8.    --logLevel=debug \
  9.    --defaultSchemaName=sep \
  10.    generateChangeLog

Here is a fragment of postgresql_changelog.xml:

  1. ...
    <createTable tableName="table1">
        <column name="total_pk" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="form_fk" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="territory_fk" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="parameter_fk" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="enterprise_fk" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="total_g" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="total_data" type="date">
            <constraints nullable="false"/>
        </column>
        <column name="total_value" type="numeric(*, 2)">
            <constraints nullable="false"/>
        </column>
        <column name="variant_fk" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="period_id" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="total_q" type="INT8"/>
        <column name="total_m" type="INT8"/>
        <column name="increase" type="INT8"/>
        <column name="period_index" type="INT8"/>
        <column name="data_input" type="TIMESTAMP WITHOUT TIME ZONE"/>
        <column name="document_unid" type="VARCHAR(64)"/>
        <column name="value_comment" type="VARCHAR(512)"/>
        <column name="olap_year" type="SMALLINT"/>
        <column name="olap_month" type="SMALLINT"/>
        <column name="olap_week" type="SMALLINT"/>
        <column name="olap_day_of_month" type="SMALLINT"/>
        <column name="olap_quarter" type="VARCHAR(4)"/>
        <column name="olap_quarter_desc" type="VARCHAR(17)"/>
        <column name="olap_month_name" type="VARCHAR(8)"/>
        <column name="ediz_id" type="INT8">
            <constraints nullable="false"/>
        </column>
        <column name="olap_month_code" type="VARCHAR(10)"/>
        <column name="olap_month_caption" type="VARCHAR(64)"/>
    </createTable>
    ...

Now I want to create the same objects and the same relationships in another database (Oracle):

  1. liquibase
       --driver=oracle.jdbc.OracleDriver
       --classpath="C:\db_drivers\ojdbc14.jar"
       --changeLogFile="./postgresql_changelog.xml"
       --url="jdbc:oracle:thin:@ip_here:orabeta"
       --username=***
       --password=***
       update

But it does not work: ORA-00902

It is possible to get changelog from one database and update another database in different RDBMS server from this changelog? I need to get automatic data type conversion.


Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>