[英]Yii2 migrate/create with {{%table}} option
Is it possible to create a migration using the yii migrate/create
command in Yii2, which can create a table with table prefix? 是否可以在Yii2中使用yii migration yii migrate/create
命令yii migrate/create
,该命令可以创建带有表前缀的表?
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 {{%...}} 我想得到如上例所示的结果,但是yii migrate/create
命令创建时没有{{%...}}
采用
yii migrate/create name --useTablePrefix=1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.