カラム移動の失敗
カラムの移動をしようと ALTER したら失敗した。
バージョンを上げたら発生しなくなった。謎。
sql_mode は
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
ログ
- 5.7.18
root@localhost[xxx]> ALTER TABLE t_order -> MODIFY COLUMN `order_date` datetime NOT NULL COMMENT '注文日時' AFTER cart_name -> ; ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column 'order_date' at row 1
- 5.7.20
root@localhost[xxx]> ALTER TABLE t_order -> MODIFY COLUMN `order_date` datetime NOT NULL COMMENT '注文日時' AFTER cart_name -> ; Query OK, 0 rows affected (2.10 sec) Records: 0 Duplicates: 0 Warnings: 0