0 follower

Final Class M240409200600CreateQueueTable

InheritanceM240409200600CreateQueueTable
ImplementsYiisoft\Db\Migration\RevertibleMigrationInterface, Yiisoft\Db\Migration\TransactionalMigrationInterface

Constants

Hide inherited constants

Constant Value Description Defined By
QUEUE_TABLE 'queue' M240409200600CreateQueueTable

Method Details

Hide inherited methods

down() public method

public void down ( \Yiisoft\Db\Migration\MigrationBuilder $b )
$b \Yiisoft\Db\Migration\MigrationBuilder

                public function down(MigrationBuilder $b): void
{
    $b->dropTable(self::QUEUE_TABLE);
}

            
up() public method

public void up ( \Yiisoft\Db\Migration\MigrationBuilder $b )
$b \Yiisoft\Db\Migration\MigrationBuilder

                public function up(MigrationBuilder $b): void
{
    $b->createTable(
        self::QUEUE_TABLE,
        [
            'id' => 'int NOT NULL AUTO_INCREMENT',
            'channel' => 'varchar(255) NOT NULL',
            'job' => 'blob NOT NULL',
            'pushed_at' => 'int NOT NULL',
            'ttr' => 'int NOT NULL',
            'delay' => 'int NOT NULL DEFAULT 0',
            'priority' => 'int UNSIGNED NOT NULL DEFAULT 1024',
            'reserved_at' => 'int DEFAULT NULL',
            'attempt' => 'int DEFAULT NULL',
            'done_at' => 'int DEFAULT NULL',
            'PRIMARY KEY ([[id]])',
            'KEY channel ([[channel]])',
            'KEY reserved_at ([[reserved_at]])',
            'KEY priority ([[priority]])',
        ],
    );
}