Pergunta

I'm developing a web application that also use Wordpress as part of it. I want to use Liquibase to track my database changes.

How to handle database changes made by automatic update script of Wordpress?

Can I just ignore them? and put only my own changes in Liquibase changelog file?

Foi útil?

Solução

You could do a diffChangelog of the schemas after each WordPress upgrade so that Liquibase could keep track of the changes. You can just ignore them though - Liquibase doesn't really care about unknown schema objects. The only issue would be if your changes and the WordPress changes conflicted.

Outras dicas

You can and should just ignore them.

Liquibase just does one thing. It keeps track of the fact that:

  • a certain command (say, createTable)...
  • ...that looked a certain way at time 0 (the name of the table, its columns, etc.)...
  • ...was definitively executed at time 0 (it stores this record in DATABASECHANGELOG).

That's it. It is not a structure enforcer or a database state reconstitution engine. It is quite possible—and permitted, and often expected—that the database will be changed by other tools and Liquibase will have no idea what went on.

So just keep your commands in your changelogs, don't worry about preexisting database structure, use preconditions to control whether or not your changesets run, and ignore everything else that might be going on in the database that happened due to other tools.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top