mirror of
https://github.com/CyanoFresh/SmartHomePHP.git
synced 2026-03-03 00:24:01 +01:00
26 lines
538 B
PHP
26 lines
538 B
PHP
<?php
|
|
|
|
use yii\db\Migration;
|
|
|
|
class m161126_185030_create_task 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', [
|
|
'id' => $this->primaryKey(),
|
|
'name' => $this->string()->notNull(),
|
|
], $tableOptions);
|
|
}
|
|
|
|
public function safeDown()
|
|
{
|
|
$this->dropTable('task');
|
|
}
|
|
}
|