# Error running yaml changelog after using generateChangeLog on database

**URL:** <https://forum.liquibase.org/t/error-running-yaml-changelog-after-using-generatechangelog-on-database/3269>\
**Category:** General Discussion\
**Created:** [August 21, 2015, 2:12am UTC](https://forum.liquibase.org/t/error-running-yaml-changelog-after-using-generatechangelog-on-database/3269 "2015-08-21T02:12:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![molson](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@molson](https://forum.liquibase.org/u/molson)\
**Post date:** [August 21, 2015, 2:12am UTC](https://forum.liquibase.org/t/error-running-yaml-changelog-after-using-generatechangelog-on-database/3269/1 "2015-08-21T02:12:00Z")

</div>

Hello,

I’m wondering if someone can provide me some direction on what I’m doing wrong in generating my yaml file. I currently have my changelogs in xml and it was decided we would convert everything to yml. I used the generateChangeLog on my database that was built using the xml to reverse it all into yml. When I try to run my liquibase update with the newly created yml files in a clean database I’m receiving an error. What is happening is my datetime fields that have a defaultValueComputed: CURRENT\_TIMESTAMP are being translated to now() in the sql statement and throwing an error during my run. This is what the generateChangeLog created in the create table statement:

```
    - column:</div>

        constraints:</div>

          constraints:</div>

            nullable: false</div>

        defaultValueComputed: CURRENT_TIMESTAMP</div>

        name: CreateDateTime</div>

        type: datetime(6)</div></div>

```

and here is the error:

Unexpected error running Liquibase: Invalid default value for ‘CreateDateTime’

…inside the create statement - CreateDateTime datetime(6) DEFAULT NOW() NULL

In case it helps the table that exists in the database was created with the column looking like this in xml:

```
       <column defaultValueComputed="CURRENT_TIMESTAMP" name="CreatedDateTime" type="datetime"></div>

            <constraints nullable="false"/></div>

        </column></div></div>

```

I am using liquibase 3.4.1

Thank you!

---

<div class="post-metadata">

**Author:** ![un1394593507669r21id](https://avatars.discourse-cdn.com/v4/letter/u/e47c2d/32.png) [@un1394593507669r21id](https://forum.liquibase.org/u/un1394593507669r21id)\
**Post date:** [August 21, 2015, 2:12am UTC](https://forum.liquibase.org/t/error-running-yaml-changelog-after-using-generatechangelog-on-database/3269/2 "2015-08-21T02:12:00Z")

</div>

In case it helps anyone I figured out the issues with the above.

When running the generateChangeLog it gave me a type of datetime(6) which I was then passing defaultValueComputed: CURRENT\_TIMESTAMP which was evaluated to now(). Once I changed it to just datetime all is well.

One other issue I was seeing was my constraints were not properly being evaluated so that I was ending up with not null fields or a missing primary key and that turned out to be because of the double “constraints:” lines as seen above. Once I removed one of the “constraints:” my primary keys and null constraints started working correctly.
