-
-
Notifications
You must be signed in to change notification settings - Fork 294
/
M161119140200Queue.php
42 lines (35 loc) · 1.05 KB
/
M161119140200Queue.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/
namespace yii\queue\db\migrations;
use yii\db\Migration;
/**
* Example of migration for queue message storage.
*
* @author Roman Zhuravlev <[email protected]>
*/
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);
}
}