Using the lybase base according to the existing scheme

I read about how you can generate a changelog.xml file from an existing schema. This is great, but I have existing systems that I donโ€™t want to touch, except to make new changes. I also have completely new systems that require all changes.

So, I want Liquibase to only perform migrations from change set X when working on an existing system. That is, this system database is in the X-1 edition (but without sysys linibase tables), and I do not want any previous migrations to be applied.

Thanks a lot Pat

+7
source share
2 answers

I think that the easiest way would be to first perform the initial setup in an empty database and export the record (s) that the liquid base inserts into the DATABASECHANGELOG table. Then I export these records and manually insert them into one of the target databases in the DATABASECHANGELOG table so that Liquibase does not โ€œchangeโ€ there again.

Of course, I would check all this with test dumps on a test machine ... :)

+2
source

I would recommend a slightly different approach, as Liquibase commented on this forum.

  • Create a change log from your existing schema. CLI Liquibase can do it for you. I usually take the resulting XML and smooth it a bit (group-related changes into separate change lists, special cleanups, etc.), but Liquibase does most of the work.

  • run this change log with the existing database ( changelogSync command), but only marking it as applicable (without actually modifying the schema).

  • use Liquibase to apply new changes from this point.

+14
source

All Articles