# How to generate liquibase change logs along with basic preconditions ?

**URL:** <https://forum.liquibase.org/t/how-to-generate-liquibase-change-logs-along-with-basic-preconditions/3587>\
**Category:** General Discussion\
**Created:** [January 22, 2018, 5:08pm UTC](https://forum.liquibase.org/t/how-to-generate-liquibase-change-logs-along-with-basic-preconditions/3587 "2018-01-22T17:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uday](https://avatars.discourse-cdn.com/v4/letter/u/ce7236/32.png) [@Uday](https://forum.liquibase.org/u/Uday)\
**Post date:** [January 22, 2018, 5:08pm UTC](https://forum.liquibase.org/t/how-to-generate-liquibase-change-logs-along-with-basic-preconditions/3587/1 "2018-01-22T17:08:00Z")

</div>

Hi,

I used generateChangeLog command on an existing database. It helped me auto generating ‘create’ changesets for all tables, sequences.&nbsp;

I am interested to know if there is a way to doing same and get preconditions included using generateChangeLog. Say to include basic precondition like if table or sequence already exists.

I went through liquibase documentation but couldn’t find any help on this. Googled, but couldn’t find much relevant, useful help.

Can anyone let me know if this is possible ?

I can help myself if pointed out to any useful knowledge source too.

Any help is appreciated.

More details:

database: postgres 9.5

liquibase-maven-plugin: 3.4.1

---

<div class="post-metadata">

**Author:** ![un1487172425529r6id](https://avatars.discourse-cdn.com/v4/letter/u/d6d6ee/32.png) [@un1487172425529r6id](https://forum.liquibase.org/u/un1487172425529r6id)\
**Post date:** [January 22, 2018, 5:08pm UTC](https://forum.liquibase.org/t/how-to-generate-liquibase-change-logs-along-with-basic-preconditions/3587/2 "2018-01-22T17:08:00Z")

</div>

I don’t think this is possible, but sounds like a reasonable change request for&nbsp;[https://liquibase.jira.com/secure/Dashboard.jspa](https://liquibase.jira.com/secure/Dashboard.jspa)

---

<div class="post-metadata">

**Author:** ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)\
**Post date:** [January 22, 2018, 5:08pm UTC](https://forum.liquibase.org/t/how-to-generate-liquibase-change-logs-along-with-basic-preconditions/3587/3 "2018-01-22T17:08:00Z")

</div>

In general, you don’t need to have preconditions for things like ‘table exists’ before the change that creates a a table because liquibase will see that the change to create the table has already been applied, and won’t try to re-apply it.&nbsp;

If you have an existing database that you are starting to bring under Liquibase management, see the page&nbsp;[http://www.liquibase.org/documentation/existing\_project.html](http://www.liquibase.org/documentation/existing_project.html) for some ideas on how to get started.&nbsp;

Steve Donie  
Principal Software Engineer  
Datical, Inc. [http://www.datical.com/](http://www.datical.com/)
