相关疑难解决方法(0)

Laravel Migrations - 创建时间戳时出现的问题

我正在尝试在我的Laravel实例上运行迁移.它们只是默认迁移(用户和密码重置),但是当它尝试生成时间戳时会抛出此错误:

 [Illuminate\Database\QueryException]
 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) 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)
Run Code Online (Sandbox Code Playgroud)

以及PDOException:

SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at'
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?

谢谢.

php mysql migration laravel

13
推荐指数
2
解决办法
1万
查看次数

标签 统计

laravel ×1

migration ×1

mysql ×1

php ×1