Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Timestamp Datatype Issue

forums forums SQLyog SQLyog: Bugs / Feature Requests Timestamp Datatype Issue

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #12570
      Karry
      Member

      when creating a table in the designer it now defaults to creating the table that updates the timestamp on row update.

      This sql:

      on update current_timestamp

      How can I change the default behavior to not add the command so it is an on insert only timestamp?

      Plus how to I view the table creation sql on an existing table without having to do a sqldump?

    • #33065
      ashwin
      Member

      Hello,

      Quote:
      when creating a table in the designer it now defaults to creating the table that updates the timestamp on row update. How can I change the default behavior to not add the command so it is an on insert only timestamp?

      Please read this FAQ:

      http://www.webyog.com/faq/content/8/159/en/how-do-i-define-timestamp-properties-with-sqlyog.html

      If you want to do this- (NOT) NULL DEFAULT CURRENT_TIMESTAMP, then “Just define the column type and name/identifier and enter “CURRENT_TIMESTAMP” (without quotes) in the default column. You may check the NOT NULL checkbox or not and the column will be created accordingly. “

      I guess you are just adding NOT NULL to TIMESTAMP without adding the CURRENT_TIMESTAMP as default. That's why you are getting “on update current_timestamp” but not DEFAULT CURRENT_TIMESTAMP.

      Quote:
      Plus how to I view the table creation sql on an existing table without having to do a sqldump?

      Click the tablename in the Object browser and open the INFO tab and you can see the Create table statement for the table. The DDL information of the table will be shown in the INFO tab.

      Regards,

      Ashwin A

Viewing 1 reply thread
  • You must be logged in to reply to this topic.