ID #1083

How does SQLyog handle TIMESTAMPS defined as '... on UPDATE CURRENT_TIMESTAMP' ?

 

You can read about SQLyog 'smart' KEYWORD handling introduced with SQLyog 5.1 here.

 

When updating any TIMESTAMP defined with

'... on UPDATE CURRENT_TIMESTAMP'

SQLyog will not include that column in the update statement, and the server will replace the old TIMESTAMP with a new CURRENT_TIMESTAMP. This is the basic idea with the '... on update ..' clause and is fully supported by SQLyog.

 

To create a TIMESTAMP default CURRENT_TIMESTAMP not NULL on UPDATE CURRENT_TIMESTAMP with MySQL >= 4.1 (and if this TIMESTAMP is the first TIMESTAMP of the table) you will only need to check the 'Not Null' checkbox from SQLyog GUI's (CREATE TABLE, ALTER TABLE). The first TIMESTAMP in a table defined NOT NULL will be created as TIMESTAMP default CURRENT_TIMESTAMP not NULL on UPDATE CURRENT_TIMESTAMP by the MySQL server then. SQLyog does not 'override' this in any way.

 

Tags: -

Related entries:

You can comment this FAQ