CREATE TABLE `altas_talleres` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`fecha` DATE NULL,
`socio_id` INT(10) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_altas_talleres_socios` (`socio_id`),
CONSTRAINT `FK_altas_talleres_socios` FOREIGN KEY (`socio_id`) REFERENCES `socios` (`idsocio`) ON UPDATE CASCADE
)
COLLATE='utf8_spanish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=8;
... unchecking the "Allow NULL" check-box and hitting "Save" in the table editor throws this error:
SQL Error (1292): Incorrect date value: '0000-00-00' for column 'fecha' at row 1
If you copy the SQL statements from the "ALTER code" tab to a query tab, you get the same result. However, if you go to "Tools-> Launch command line" and run them there, everything goes smoothly:
mysql> ALTER TABLE `altas_talleres`
-> ALTER `fecha` DROP DEFAULT;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> ALTER TABLE `altas_talleres`
-> CHANGE COLUMN `fecha` `fecha` DATE NOT NULL AFTER `id`;
Query OK, 6 rows affected (0.27 sec)
Records: 6 Duplicates: 0 Warnings: 0
It's 100% reproducible here. I'm using latest snapshot and a local 5.5.11 MySQL server on Windows XP.
P.S. Anse, if you forget to type the subject you lose the complete message!