Laravel Migrations - Issues while creating timestamps

后端 未结 10 585
深忆病人
深忆病人 2021-02-05 15:35

I am trying to run migrations on my Laravel instance. They are just the default migrations (users and password resets) but when it tries to make the timestamps it throws this e

10条回答
  •  悲&欢浪女
    2021-02-05 16:35

    You can use nullableTimestamps() instead of timestamps()

    or else

    $table->timestamp('created_at')->default(\DB::raw('CURRENT_TIMESTAMP'));
    

    also, check the database server version

    Please have a look on these ref links:

    https://github.com/laravel/framework/issues/3602

    https://laracasts.com/discuss/channels/forge/syntax-error-or-access-violation-1067-invalid-default-value-for-created-at

提交回复
热议问题