MySQL TIMESTAMP default value

Hi,

I want to write a createTable-changeset which result in the following:

    CREATE my_table (ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP);

How can I accomplish this with the createTable-tag? I have tried quite a lot but no success.

Grateful for your help

Best regards /Lasse

Have tried

?
Originally posted by: taranenko
Have tried
?

Yes but with defaultValueDate … forgot to mention that I am running 1.9.3 of Liquibase.
However, type=“TIMESTAMP” gives me DATETIME in the create statement.

Originally posted by: svaret
Yes but with defaultValueDate ... forgot to mention that I am running 1.9.3 of Liquibase. However, type="TIMESTAMP" gives me DATETIME in the create statement.
I guess this is artifacts that originally was influences with old known Oracle inconsistence (bug?) concerns date times types in different Oracle 8/9/10 version. No chance to switch to the Lqb 2.0?

Ok fixed in 2.0?

Will start migrating asap then. Thx

sorry about my previous post, I’ve skipped you use MySql, not Oracle  ;)
Switch to 2.0 does allow you extend the particular SQLGenerator, if currently has unexpected behavior. To check if it already fixed, create a separate project. You use maven, it should take not much time.
Caution: in 2.0 Liqubase plugin is renamed: liquibase-maven-plugin, not liquibase-plugin as in 1.9.x

Originally posted by: taranenko
Have tried
?

(Jumping in to this thread.)  Tell me about defaultValueComputed.  I am not familiar with that one.  It doesn’t show up in http://www.liquibase.org/manual/column.

Best,
Laird

It is new in 2.0.  I’ll add it to the page. 

Basically, it allows you to specify a function as the default value, rather than a static value.  Liquibase will never attempt to quote it.  It was added to handle cases like your CURRENT_TIMESTAMP value.

Nathan

I’m not sure too, guess it designed to add computational formula as a column attribute at the database-agnostic manner. You Nathan, right?