guild/console/migrations/m191205_092846_create_note_table.php
2019-12-10 17:22:20 +03:00

32 lines
617 B
PHP
Executable File

<?php
use yii\db\Migration;
/**
* Handles the creation of table `{{%notes}}`.
*/
class m191205_092846_create_note_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createTable('note', [
'id' => $this->primaryKey(),
'name' => $this->string()->notNull(),
'description' => $this->text(),
'created_at' => $this->dateTime(),
'updated_at' => $this->dateTime(),
]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropTable('note');
}
}