Files
SmartHomePHP/migrations/m161126_185035_create_action.php
Alex Solomaha 54b0cb32f5 #14 Events
2016-11-26 22:35:03 +02:00

30 lines
741 B
PHP

<?php
use yii\db\Migration;
class m161126_185035_create_action extends Migration
{
public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('task_action', [
'id' => $this->primaryKey(),
'type' => $this->smallInteger()->notNull(),
'item_id' => $this->integer(),
'item_value' => $this->string(),
'task_id' => $this->integer(),
'name' => $this->string()->notNull(),
], $tableOptions);
}
public function safeDown()
{
$this->dropTable('task_action');
}
}