When running the phinx database migration tool, we receive an invalid datetime format error during the OneRegionPerPlaylistMigration. Below is the full error. How can this be resolved?
== 20180131122645 OneRegionPerPlaylistMigration: migrating
[PDOException]
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'createdDt' at row 1
migrate [-c|--configuration CONFIGURATION] [-p|--parser PARSER] [-e|--environment ENVIRONMENT] [-t|--target TARGET] [-d|--date DATE] [-x|--dry-run]
I had the same problem running MySQL 5.7 with the default settings even though it had worked fine in 1.8. Unfortunately, the failed migration hosed my DB and forced me to restore from a backup.
Had to load a config to remove the NO_ZERO_DATE requirement.
[mysqld]
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Turns out we were also running mySQL 5.7, not 5.6. It appears that will the release of 1.8.0, Xibo specified mySQL 5.6 (before that no version was specified). We also did not experience any issues until this release.
The problem was resolved by downgrading