Вопрос

I have an old liquibase scripts (inherited, everywhere using instead of create table, insert etc). I want to rewrite because the old one does not work with h2 (only works with Oracle).

How can I do that? (I have many data in the existing database which I need, but I want to completely rewrite the pull up script)

Это было полезно?

Решение

One option is to use the generateChangeLog command against your existing Oracle database to re-generate a new file. There are some things generateChangeLog misses such as stored procedures but will capture all the tables, columns, indexes, foreign keys, etc. The data types will be oracle specific but you can do a simple search/replace to fix them into something more generic.

Alternately, you could take your existing changelog file as a starting point and edit it as heavily as you need. If you take out changeSets liquibase will not care but when you modify an existing changeSet you will need to add a new a validChecksum tag to let Liquibase know it is expected that the changeSet has changed.

When you do find changeSets that need be different between Oracle and H2 you can use the dbms attribute on changeSet to target one type or the other.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top