<?php

use yii\db\Migration;

class m160216_145545_add_message_templates_table extends Migration
{
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
        $this->createTable(
            'message_template',
            [
                'id' => $this->primaryKey(),
                'name' => $this->string(255)->notNull(),
                'template' => $this->text()->notNull(),
                'created_at' => $this->dateTime()->notNull()
            ]
        );
    }

    public function safeDown()
    {
        $this->dropTable(
            'message_template'
        );
    }
}
