0

Is it possible to create a migration using the yii migrate/create command in Yii2, which can create a table with table prefix?

For example:

public function up()
{
    $this->createTable('{{%settings}}', [
        'id' => $this->primaryKey(),
        'keyname' => $this->string()->unique(),
        'description' => $this->text(),
        'value' => $this->string(),
        'type' => $this->string()
    ]);
}

I want to get result like above example, but yii migrate/create command creates without {{%...}}

1 Answers1

3

Use

yii migrate/create name --useTablePrefix=1
Bizley
  • 17,392
  • 5
  • 49
  • 59