Home > Net >  Liquibase - Generating Change Logs including data with Java
Liquibase - Generating Change Logs including data with Java

Time:02-10

I want to generate a changeLog with liquibase from an existing database what also includes the data.

For that I want to use the Java API version of Liquibase.

I can successfully generate the database structure, but not the data itself.

ResourceAccessor resourceAccessor = new FileSystemResourceAccessor();
DiffOutputControl diffOutputControl = new DiffOutputControl();

Database database =
      DatabaseFactory.getInstance()
          .openDatabase(
              "jdbc:h2:mem:inmemorydb",
              "username",
              "password",
              "org.h2.Driver",
              null,
              null,
              null,
              resourceAccessor);

  CommandLineUtils.doGenerateChangeLog(
      "changelog-data.xml",
      database,
      new CatalogAndSchema[] {CatalogAndSchema.DEFAULT},
      null,
      "testuser",
      null,
      null,
      diffOutputControl);

What did I miss? The changeLog is missing the data from the database.

CodePudding user response:

  •  Tags:  
  • Related