Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate changlogFile in.sql format?

Tags:

liquibase

I did run this query to genereate changelogFile in .sql format

liquibase --driver=com.mysql.jdbc.Driver 
          --classpath=mysql-connector-java-5.1.24-bin.jar 
          --changeLogFile=test_diff.sql 
          --url="jdbc:mysql://localhost/provision"
          --username=root 
          --password=** 
           diffChangeLog 
          --referenceUrl=jdbc:mysql://localhost/provision_old 
          --referenceUsername=root 
          --referencePassword=***

I get following error

Liquibase Update Failed: No serializer associated with the filename or extension 'sql'
SEVERE 5/2/13 12:50 PM:liquibase: No serializer associated with the filename or extension 'sql'
java.lang.RuntimeException: No serializer associated with the filename or extension 'sql'

Is it possible to generate changelogfile in .sql formate?

like image 405
dsatya Avatar asked May 02 '13 07:05

dsatya


People also ask

What is DB changelog?

It is a file that contains a record of all your database changes (changesets). Liquibase uses this changelog record to audit your database and execute any changes that are not yet applied to your database.

What is SQL changeset?

The changeset tag is a unit of change that Liquibase executes on a database and which is used to group database Liquibase Change Types together. A list of changes created by multiple changesets are tracked in a changelog.

What is Liquibase formatted SQL?

Liquibase (LB) is an open source tool written in Java. It makes defining database changes easy, in a format that's familiar and comfortable to each user. Then, it automatically generates database-specific SQL for you. Database changes (every change is called changeset) are managed in files called changelogs.


2 Answers

Add param:

--changeLogFile=fileName.databaseType.sql

This is my worked sample (liquibase 3.6.3):

liquibase.bat^
    --changeLogFile=databaseChangeLog.oracle.sql^
    --driver=oracle.jdbc.OracleDriver ^
    --url=jdbc:oracle:thin:@//localhost:1521/orcl ^
    --username=uat ^
    --password=uat ^
    diffChangeLog ^
    --referenceDriver=oracle.jdbc.OracleDriver ^
    --referenceUrl=jdbc:oracle:thin:@//localhost:1521/orcl ^
    --referenceUsername=test ^
    --referencePassword=test ^
like image 142
Neo Pham Avatar answered Oct 13 '22 14:10

Neo Pham


Try with this param:

--changeLogFile="./changelog.mysql.sql"

Can refer here.

like image 24
Minh Minh Avatar answered Oct 13 '22 14:10

Minh Minh