June 11, 2013 at 10:23 am #12999
Using mySQL 5.6.10 and SQLYog lastest v11.12 32bits.
I have the following table:
CREATE TABLE `tbmdtest005` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`created_by` bigint(20) DEFAULT '1',
`updated_by` bigint(20) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci
I am trying to change the default behavior of columns created_at and updated_at through the SQLYog GUI with Alter Table option.
If I try to set any value in the Default column, when I click on save the value in the Default column is converted to string, adding two single mark ' ' and the result SQL is wrong:
ALTER TABLE `md_db001`.`tbmdtest005` CHANGE `created_at` `created_at` DATETIME DEFAULT 'CURRENT_TIMESTAMP' NOT NULL;
If I execute the same SQL without the single marks its executed perfectly:
ALTER TABLE `md_db001`.`tbmdtest005` CHANGE `created_at` `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL;
1 queries executed, 1 success, 0 errors, 0 warnings
Query: ALTER TABLE `md_db001`.`tbmdtest005` CHANGE `created_at` `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
0 row(s) affected
Is it a bug or is it there anyway to set those mySQL values with SQLYog GUI without having to type the SQL query?
June 11, 2013 at 10:54 am #34346
Issue confirmed. It is fixed in the development tree and will be available in today's release.
June 11, 2013 at 11:58 am #34347
June 11, 2013 at 1:48 pm #34348
It has been released now. Please refer: http://blog.webyog.com/2013/06/11/sqlyog-mysql-gui-11-12-released/
June 12, 2013 at 8:54 am #34349
Hi peterlaursen, I think found two issues in lastest v11.12. Im not able to set the value through the GUI of SQLYog for:
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
1. It still converts some reserved mySQL values to string:
ALTER TABLE `tbmdtest005` CHANGE `onupdate_at` `onupdate_at`
DATETIME DEFAULT 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP' NOT NULL;
There could be more cases like:
DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP
Documentation maybe could help to get all cases, or another option should be not converting some mySQL reserved words for the default column to strings.
2. In the GUI if we set the default value to: CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , the value shown in the GUI default column is: CURRENT_TIMESTAMP
Maybe there could be added another column in the GUI for the ON UPDATE event statement for tables.
June 13, 2013 at 6:23 am #34350
Please refer this FAQ which would be helpful for you in defining TIMESTAMPs for CREATE TABLE and ALTER TABLE : http://faq.webyog.com/content/8/159/en/how-do-i-define-timestamp-properties-with-sqlyog.html
You must be logged in to reply to this topic.