Commit f92586bc authored by Shakarim Sapa's avatar Shakarim Sapa

- Add the migration for new column (message_template_id)

parent 3482945b
<?php
use yii\db\Migration;
class m160428_141739_add_tamplates_column_to_posts_table extends Migration
{
public function up()
{
$this->addColumn(
'posts',
'template_id',
$this->integer(11)->defaultValue(NULL)
);
$this->addForeignKey(
'fk_posts_tamplate_id',
'posts', 'template_id',
'message_tempalte', 'id'
);
}
public function down()
{
$this->dropForeignKey(
'fk_posts_tamplate_id',
'posts'
);
$this->dropColumn(
'posts',
'template_id'
);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment