You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
1.2 KiB

<?php
use yii\db\Migration;
/**
* Class m191112_005702_create_table_comment
*/
class m191112_005702_create_table_comment extends Migration
{
/**
* {@inheritdoc}
*/
public function up()
{
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="评论记录表"';
$this->createTable('ats_comment', [
'id' => $this->primaryKey(),
'user_id'=>$this->integer(11)->notNull()->comment('用户id'),
'order_goods_id'=>$this->integer(11)->defaultValue(null)->comment('订单详情商品id'),
'star'=>$this->integer(11)->defaultValue(null)->comment('星级'),
'content'=>$this->text()->comment('评论内容'),
'status'=>$this->tinyInteger(1)->defaultValue(0)->comment('状态:1为显示,0为不显示'),
'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
],$tableOptions);
}
/**
* {@inheritdoc}
*/
public function down()
{
$this->dropTable('ats_comment');
return true;
}
}