0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

General error: 1364 Field 'uuid' doesn't have a default valueエラーが出た時の対処法

Posted at

エラーメッセージ

General error: 1364 Field 'uuid' doesn't have a default value (SQL: insert into `failed_jobs` (`connection`, `queue`, `payload`, `exception`, `failed_at`) values (database, default, {"uuid":"6c370f45-895f-4b6b-99dd-53443ddcfc61",...

原因

Laravelでジョブ失敗テーブルを作成し、わざと例外を発生させジョブを失敗させたところ該当のエラーが出現した。

原因としてはconfig/queue.php'failed'driverdatabase-uuids設定されていなかったため。
日本語公式にも説明がなかったため注意が必要。

.php
    /*
    |--------------------------------------------------------------------------
    | Failed Queue Jobs
    |--------------------------------------------------------------------------
    |
    | These options configure the behavior of failed queue job logging so you
    | can control which database and table are used to store the jobs that
    | have failed. You may change them to any database / table you wish.
    |
    */

    'failed' => [
        'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), //これ
        'database' => env('DB_CONNECTION', 'mysql'),
        'table' => 'failed_jobs',
    ],

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?