We are using SQL formatted changelogs. We have a sql file, create_db.sql
for each postgres database managed via liquibase. We have few common tables for each database which is placed in a common.sql
file.
It looks like include element can serve my purpose. But it does not work with SQL formatted changelogs.
One approach I can think of handling this case is to not have common.sql altogether and place all the common code in each create_db.sql
as I could not find any good way of importing common.sql
in each create_db.sql to be managed via liquibase using sql formatted changelogs. But this will cause a lot of code duplication.
Can someone suggest some other better way of managing the common.sql
file also via liquibase for each postgres database?