forked from php-danfu.shenzhenbenwo.com

lefengyang
2025-09-10 3c9dcaf742cfa3e3c2b0843c8752cf7713aaf1fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
 
use think\migration\db\Column;
use think\migration\Migrator;
 
class CreateJobsTable extends Migrator
{
    public function change()
    {
        $this->table('{{table}}')
            ->addColumn(Column::string('queue'))
            ->addColumn(Column::longText('payload'))
            ->addColumn(Column::tinyInteger('attempts')->setUnsigned())
            ->addColumn(Column::unsignedInteger('reserved_at')->setNullable())
            ->addColumn(Column::unsignedInteger('available_at'))
            ->addColumn(Column::unsignedInteger('created_at'))
            ->addIndex('queue')
            ->create();
    }
}