for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use yii\db\Migration;
class m170424_075136_add_language_translate extends Migration
{
public $tableName = 'language_translation';
public function safeUp()
$this->createTable($this->tableName,[
'language_translation_id' => $this->primaryKey()->comment('ID'),
'language_id' => $this->integer()->notNull()->comment('Language'),
'model_class' => $this->string(255)->notNull()->comment('Translated model class name'),
'model_field_name' => $this->string(128)->notNull()->comment('Translated model field Name'),
'model_id' => $this->integer()->notNull()->comment('Translated model ID'),
'value' => $this->text()->notNull()->comment('Translated model class name'),
]);
$this->addForeignKey('fk_language_translation_language_id','language_translation','language_id','language','language_id');
}
public function safeDown()
$this->dropTable($this->tableName);