立即创建表格字段
yii migrate/create create_post_table --fields="title:string,body:text"
产生:
/**
* Handles the creation for table `post`.
*/
class m150811_220037_create_post_table extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
$this->createTable('post', [
'id' => $this->primaryKey(),
'title' => $this->string(),
'body' => $this->text(),
]);
}
/**
* @inheritdoc
*/
public function down()
{
$this->dropTable('post');
}
}