# Nullable TIMESTAMP columns in MySQL are not nullable.

**URL:** <https://forum.liquibase.org/t/nullable-timestamp-columns-in-mysql-are-not-nullable/1416>\
**Category:** Liquibase Development\
**Created:** [July 15, 2010, 6:20pm UTC](https://forum.liquibase.org/t/nullable-timestamp-columns-in-mysql-are-not-nullable/1416 "2010-07-15T18:20:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpjust](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@cpjust](https://forum.liquibase.org/u/cpjust)\
**Post date:** [July 15, 2010, 6:20pm UTC](https://forum.liquibase.org/t/nullable-timestamp-columns-in-mysql-are-not-nullable/1416/1 "2010-07-15T18:20:00Z")

</div>

Hi,  
I noticed that in MySQL, if you add a TIMESTAMP column without specifying NULL or NOT NULL it defaults to NOT NULL which is backwards from every other type.  
If I specify for TIMESTAMP columns in the Liquibase changelog, then load it into an HSQL database and do a diff against an empty MySQL database, the SQL output that it uses to create the table specifies “columnName TIMESTAMP” instead of “columnName TIMESTAMP NULL”.

Would it be hard to change it so that the SQL script generated by Diff always specifies ‘NULL’ for nullable columns?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [July 15, 2010, 6:20pm UTC](https://forum.liquibase.org/t/nullable-timestamp-columns-in-mysql-are-not-nullable/1416/2 "2010-07-15T18:20:00Z")

</div>

Is that just TIMESTAMP columns?&nbsp; It seemed that sybase was the only database that actually needed the NULL clause, from my earlier testing.

Nathan

---

<div class="post-metadata">

**Author:** ![hiro2k](https://avatars.discourse-cdn.com/v4/letter/h/f475e1/32.png) [@hiro2k](https://forum.liquibase.org/u/hiro2k)\
**Post date:** [July 15, 2010, 6:20pm UTC](https://forum.liquibase.org/t/nullable-timestamp-columns-in-mysql-are-not-nullable/1416/3 "2010-07-15T18:20:00Z")

</div>

This is still a problem and it’s exactly as cpjust describes, if I add a constraint that sets nullable to true it doesn’t issue a create statement with “columnName TIMESTAMP NULL”.

For now I’m creating the column like so as a workaround:&nbsp;

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [July 15, 2010, 6:20pm UTC](https://forum.liquibase.org/t/nullable-timestamp-columns-in-mysql-are-not-nullable/1416/4 "2010-07-15T18:20:00Z")

</div>

I created [http://liquibase.jira.com/browse/CORE-859](http://liquibase.jira.com/browse/CORE-859) to track the bug  
  
Nathan
