我把我的项目从5.2升级到了laravel 5.3.现在,当我想要运行php artisan migrate
时,我收到错误:
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'created_at' at row 1 (SQL: alter table 100 add 101 timestamp null).
My migration:
Schema::table(Models::table('messages'), function (Blueprint $table) {
$table->softDeletes();
});
在蓝图中.php:
public function softDeletes()
{
return $this->timestamp('deleted_at')->nullable();
}