讨论 技术讨论 执行: php artisan modstart:module-install 模块名 报错

执行: php artisan modstart:module-install 模块名 报错

zqiqi 发表于    阅读:140    回复:2

问题描述:

执行: php artisan modstart:module-install Cms

出现报错:SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at'

环境信息:

PHP8.1版本、MySQL 5.7.26、系统版本 win7等

复现步骤:

1、添加表字段

    public function up()
    {
        Schema::table('cms_content', function (Blueprint $table) {
            $table->unsignedBigInteger('website_id')->after('modelId');
            $table->foreign('website_id')->references('id')->on('website')->onDelete('cascade');
        });
    }

2、执行  php artisan modstart:module-install Cms

这是怎么回事?

评论

需要查看一下具体的报错原因是什么。

可以查看日志文件 storage/logs。

 


好的,谢谢

 
1
我来评论
QQ
微信