SQLite updateSQL AddColumn

Hi All!

I’m trying to generate SQL statements for a changelog for an Android application using SQLite (so that it can track the necessary changes required for its internal database).
Now when the changelog contains simple table creation, Liquibase works flawlessly:

<createTable tableName="user">
  <column name="id" type="TEXT">
    <constraints nullable="false" primaryKey="true"/>
  <column name="name" type="TEXT">
    <constraints nullable="false"/>

However, when I try to run a changelog modifying and already existing table, Liquibase fails with “DatabaseException: AddColumnStatement requires access to up to date database metadata which is not available in SQL output mode”:

<addColumn tableName="user">
  <column name="corporate" type="TEXT">
    <constraints nullable="true"/>

Running “update” instead of “updateSQL” works again flawlessly, but I need to generate the raw SQL statements for this scenario as well. I even tried to first do an “update” and then giving that database to the “updateSQL” command with no luck.

Question: how could I generate table modification SQL scripts?

@muczy ,

Hello! When you say:

Would it be helpful to just make your changesets in sql? And not have to use xml and then cull out sql?


Hi @ronak ,

Well that would work, but defeat the purpose of using Liquibase. :slight_smile: