2
votes

I have a project that is using liquibase for database sync. When I use maven liquibase for generating a changelog, I want to exclude some database objects whose names start with oauth_

My maven goal is like this

liquibase:diff -DdiffExcludeObjects="table:oauth_.*"

But when I execute the goal, the generated changelog includes these changesets:

<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-4">
    <dropTable tableName="oauth_access_token"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-5">
    <dropTable tableName="oauth_approvals"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-6">
    <dropTable tableName="oauth_client_details"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-7">
    <dropTable tableName="oauth_client_token"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-8">
    <dropTable tableName="oauth_code"/>
</changeSet>
<changeSet author="aliakbarazizkhani (generated)" id="1470077228335-9">
    <dropTable tableName="oauth_refresh_token"/>
</changeSet>
3
Are you using the latest version of liquibase? This functionality was introduced in 3.3.2. Just to make sure...Jens
I am using version 3.4.2ali akbar azizkhani

3 Answers

1
votes

I think the problem may be just the name of the property. Documentation indicates that the property should be exludeObjects not diffExcludeObjects.

1
votes

mvn liquibase:diff -Dliquibase.diffExcludeObjects=oauth_*

1
votes

The correct answer:

mvn liquibase:diff -Dliquibase.diffExcludeObjects="table:oauth_.*"

with -Dliquibase. is Parameter prefix.

More parameter in here