{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/8068","labels_url":"https://api.github.com/repos/laravel/framework/issues/8068/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/8068/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/8068/events","html_url":"https://github.com/laravel/framework/issues/8068","id":63096293,"number":8068,"title":"sql_mode=traditional","user":{"login":"mathiasgrimm","id":450069,"avatar_url":"https://avatars.githubusercontent.com/u/450069?v=3","gravatar_id":"","url":"https://api.github.com/users/mathiasgrimm","html_url":"https://github.com/mathiasgrimm","followers_url":"https://api.github.com/users/mathiasgrimm/followers","following_url":"https://api.github.com/users/mathiasgrimm/following{/other_user}","gists_url":"https://api.github.com/users/mathiasgrimm/gists{/gist_id}","starred_url":"https://api.github.com/users/mathiasgrimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathiasgrimm/subscriptions","organizations_url":"https://api.github.com/users/mathiasgrimm/orgs","repos_url":"https://api.github.com/users/mathiasgrimm/repos","events_url":"https://api.github.com/users/mathiasgrimm/events{/privacy}","received_events_url":"https://api.github.com/users/mathiasgrimm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-03-19T21:38:19Z","updated_at":"2015-07-22T12:25:35Z","closed_at":"2015-05-31T18:01:29Z","body":"things does not work when using sql_mode=traditional\r\n\r\n[Illuminate\\Database\\QueryException]\r\n  SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at' (SQL: create table `users` (`id` int unsigned not null auto_increment primary key, `name` varchar(255) not null, `email` varchar(255) not null, `password` varchar(60) not nu\r\n  ll, `remember_token` varchar(100) null, `created_at` timestamp default 0 not null, `updated_at` timestamp default 0 not null) default character set utf8 collate utf8_unicode_ci)\r\n\r\n\r\n\r\n\r\n\r\n\r\n  [PDOException]\r\n  SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at'\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n'mysql' => [\r\n\t\t\t'driver'    => 'mysql',\r\n\t\t\t'host'      => env('DB_HOST', 'localhost'),\r\n\t\t\t'database'  => env('DB_DATABASE', 'forge'),\r\n\t\t\t'username'  => env('DB_USERNAME', 'forge'),\r\n\t\t\t'password'  => env('DB_PASSWORD', ''),\r\n\t\t\t'charset'   => 'utf8',\r\n\t\t\t'collation' => 'utf8_unicode_ci',\r\n\t\t\t'prefix'    => '',\r\n\t\t\t'options'   => [\r\n                PDO::MYSQL_ATTR_INIT_COMMAND => \"SET sql_mode = 'TRADITIONAL'\"\r\n            ]\r\n\t\t],"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/123703576","html_url":"https://github.com/laravel/framework/issues/8068#issuecomment-123703576","issue_url":"https://api.github.com/repos/laravel/framework/issues/8068","id":123703576,"user":{"login":"mathiasgrimm","id":450069,"avatar_url":"https://avatars.githubusercontent.com/u/450069?v=3","gravatar_id":"","url":"https://api.github.com/users/mathiasgrimm","html_url":"https://github.com/mathiasgrimm","followers_url":"https://api.github.com/users/mathiasgrimm/followers","following_url":"https://api.github.com/users/mathiasgrimm/following{/other_user}","gists_url":"https://api.github.com/users/mathiasgrimm/gists{/gist_id}","starred_url":"https://api.github.com/users/mathiasgrimm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathiasgrimm/subscriptions","organizations_url":"https://api.github.com/users/mathiasgrimm/orgs","repos_url":"https://api.github.com/users/mathiasgrimm/repos","events_url":"https://api.github.com/users/mathiasgrimm/events{/privacy}","received_events_url":"https://api.github.com/users/mathiasgrimm/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T12:25:35Z","updated_at":"2015-07-22T12:25:35Z","body":"The correct value is null or the right value. 1970 is just as bad as\n0000-00-00\n\nOn 22 July 2015 at 13:11, Greg Roach <notifications@github.com> wrote:\n\n> IMHO, the correct fix is to change the default from 0 to 1970-01-01\n> 00:00:01 (the lowest value supported by MySQL).\n>\n> Since laravel alway sets the values for its own created_at and updated_at\n> columns, such a change could affect an application which:\n>\n>    - stores its own timestamps\n>    - fails to initialise them\n>    - relies on the database-supplied default as some kind of sentinel\n>    value\n>\n> I'd wager that nobody actually does this, but it would technically be a BC\n> break, hence I just suggested some workarounds.\n>\n> @GrahamCampbell <https://github.com/GrahamCampbell> - if you think such a\n> change would be accepted, I'd be delighted to submit another PR.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/laravel/framework/issues/8068#issuecomment-123697313>.\n>\n"}}