php - Laravel Migrations - Issues while creating timestamps -


i trying run migrations on laravel instance. default migrations (users , password resets) when tries make timestamps throws error:

 [illuminate\database\queryexception]  sqlstate[42000]: syntax error or access violation: 1067 invalid default value 'created_at' (sql: create table `  users` (`id` int unsigned not null auto_increment primary key, `name` varchar(255) not null, `email` varchar(255) n  ot null, `password` varchar(60) not null, `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) 

as pdoexception:

sqlstate[42000]: syntax error or access violation: 1067 invalid default value 'created_at' 

how can fix this?

thanks.

this due mysql not accepting 0 valid default date , table creation fails constraint check on creation.

you have no_zero_date enabled in mysql configuration. setting off allow create table or alternatively remove default 0 value or change current_timestamp.

you can find out more exact issue here: https://github.com/laravel/framework/issues/3602


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -