for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use yii\db\Migration;
/**
* Handles the creation of table `feedback`.
*/
class m180530_133910_create_feedback_table extends Migration
{
* {@inheritdoc}
public function safeUp()
$this->createTable('feedback', [
'id' => $this->primaryKey(),
'name' => $this->string(64)->notNull(),
'email' => $this->string(64)->notNull(),
'phone' => $this->string(32),
'subject' => $this->string()->notNull(),
'message' => $this->text()->notNull(),
'read' => $this->tinyInteger(1)->notNull()->defaultValue(0),
'created_at' => $this->dateTime(),
'updated_at' => $this->dateTime(),
]);
$this->createIndex(
'idx-feedback-read',
'feedback',
'read'
);
'idx-feedback-name',
'name'
'idx-feedback-email',
'email'
'idx-feedback-phone',
'phone'
'idx-feedback-subject',
'subject'
}
public function safeDown()
$this->dropIndex(
'feedback'
$this->dropTable('feedback');