mirror of
https://github.com/janickiy/yii2-nomer
synced 2025-03-09 15:39:59 +00:00
add files to project
This commit is contained in:
commit
5cac498444
3729 changed files with 836998 additions and 0 deletions
39
migrations/M161119140200Queue.php
Normal file
39
migrations/M161119140200Queue.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/**
|
||||
* @link https://github.com/zhuravljov/yii2-queue
|
||||
* @copyright Copyright (c) 2017 Roman Zhuravlev
|
||||
* @license http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Example of migration for queue message storage
|
||||
*
|
||||
* @author Roman Zhuravlev <zhuravljov@gmail.com>
|
||||
*/
|
||||
class M161119140200Queue extends Migration
|
||||
{
|
||||
public $tableName = '{{%queue}}';
|
||||
public $tableOptions;
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->createTable($this->tableName, [
|
||||
'id' => $this->primaryKey(),
|
||||
'channel' => $this->string()->notNull(),
|
||||
'job' => $this->binary()->notNull(),
|
||||
'created_at' => $this->integer()->notNull(),
|
||||
'started_at' => $this->integer(),
|
||||
'finished_at' => $this->integer(),
|
||||
], $this->tableOptions);
|
||||
|
||||
$this->createIndex('channel', $this->tableName, 'channel');
|
||||
$this->createIndex('started_at', $this->tableName, 'started_at');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable($this->tableName);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue