Skip to content

Liquibase won't allow create empty table with no columns in postgres #31

Open
@sync-by-unito

Description

@sync-by-unito

I have a changeset:


and running the update gets me:
ronak@Ronaks-MacBook-Pro postgres % liquibase --changeLogFile=activity3.xml --defaultsFile=liquibase.properties.dev updateSQL

Liquibase Pro 4.2.0 by Datical licensed to Liquibase Pro Customer until Mon May 17 19:00:00 CDT 2021
####################################################

  1. _ _ _ _ ##
  2. | | () () | ##
  3. | | _ __ _ _ _ | |_ __ _ _ _ ##
  4. | | | |/ | | | | | '_ \ / _ / |/ \ ##
  5. | |**| | (| | || | | |) | (_| ** \ __/ ##
  6. _**/|*, |*,||./ **,_|_/___| ##
  7. | | ##
  8. |_| ##

  1. Get documentation at docs.liquibase.com ##
  2. Get certified courses at learn.liquibase.com ##
  3. Get advanced features and support at ##
  4. liquibase.com/support ##

####################################################
Starting Liquibase at 11:08:17 (version 4.2.0 #18 built at 2020-11-13 16:49+0000)
Unexpected error running Liquibase: Validation Failed:
1 changes have validation failures
columns is empty, activity3.xml::1607273632381-1::ronak (generated)

For more information, please use the --logLevel flag
[2020-12-06 11:08:18] SEVERE [liquibase.integration] Unexpected error running Liquibase: Validation Failed:
1 changes have validation failures
columns is empty, activity3.xml::1607273632381-1::ronak (generated)

liquibase.exception.ValidationFailedException: Validation Failed:
1 changes have validation failures
columns is empty, activity3.xml::1607273632381-1::ronak (generated)

at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:298)
at liquibase.Liquibase.lambda$update$1(Liquibase.java:237)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Liquibase.runInScope(Liquibase.java:2277)
at liquibase.Liquibase.update(Liquibase.java:215)
at liquibase.Liquibase$1.run(Liquibase.java:394)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Liquibase.runInScope(Liquibase.java:2277)
at liquibase.Liquibase.update(Liquibase.java:379)
at liquibase.Liquibase.update(Liquibase.java:371)
at liquibase.integration.commandline.Main.doMigration(Main.java:1794)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:361)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Scope.child(Scope.java:226)
at liquibase.integration.commandline.Main$1.run(Main.java:360)
at liquibase.integration.commandline.Main$1.run(Main.java:193)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:193)
at liquibase.integration.commandline.Main.main(Main.java:156)

ronak@Ronaks-MacBook-Pro postgres %

It may be silly to create a table with now columns but it is legit Postgres:
https://stackoverflow.com/questions/31322009/create-empty-table-in-postgresql

Here's the sql I used to create the table:
CREATE TABLE public.ronaktable (

);

┆Issue is synchronized with this Jira Bug by Unito
┆Attachments: activity3.xml | liquibase.properties.dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions