SQL format changelog

It is working correctly for me. Can you post your sql file and how you are calling it?

Nathan

With formatted sql style changelogs you can use the sql style directly without needing a containing XML file. The changeset metadata is in the – comments.


I think I see where the problem is, there is two ways liquibase will try to parse the sql, one as formatted sql and one assuming it is just regular SQL.


The formatted sql parser expects the file to start with Also, I tried your example locally with 3.0 and it worked fine for me, could you try upgrading and see if that works better?

Nathan

Hi there, I’m having difficulty in getting the ID and AUTHOR fields to populate correctly in the DATABASECHANGELOG table. 

 

If I use an xml file for my changelog the update works fine (<changeSet id=“1” author=“testuser”>) but I want to use a SQL file (–changeset testuser:1) which results in ID being set to raw and AUTHOR set to includeAll.

 

Help!

Here are the contents of my sql file:

  1. –liquibase formatted sql
    –changeset testuser:1
    create table test1 (
        id int primary key,
        name varchar(255)
    );

I’m calling it from the command line with the following:

  1. java -jar liquibase.jar --driver=com.microsoft.sqlserver.jdbc.SQLServerDriver --classpath=sqljdbc4.jar --changeLogFile=ods_changelog_sql.sql --url=“jdbc:sqlserver://tl-test5\SQLEXPRESS:1433;DatabaseName=Liquibase_Eval” --username=sa --password=ibuser update

 

It’s Liquibase version 2.0.5.

 

Thanks for taking the time to look at this.

Don’t you must create a changelog that call the SQL changeset instead of calling directly the changeset ?