customising Job and job table in Laravel queue/ rename jobs table

前端 未结 1 1626
渐次进展
渐次进展 2020-12-21 02:02

When I try php artisan queue:table It gave me the following error

  [InvalidArgumentException]                   
  A CreateJobsTable migration         


        
相关标签:
1条回答
  • 2020-12-21 02:37

    Yes. Edit this file config\queue.php:

    <?php
    
    return [
    
        ....
    
        'connections' => [
    
            ....
    
            'database' => [
                'driver' => 'database',
                'table' => 'jobs',      <------ Edit this to something else
                'queue' => 'default',
                'retry_after' => 90,
            ],
    
            ....
        ],
    
        ....
    ];
    

    Change the table name to other value, and it should pick up by the TableCommand. Check out Illuminate\Queue\Console\TableCommand on how it uses this value. It's pretty much straightforward :)

    0 讨论(0)
提交回复
热议问题