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

  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m191112_005702_create_table_comment
  5. */
  6. class m191112_005702_create_table_comment extends Migration
  7. {
  8. /**
  9. * {@inheritdoc}
  10. */
  11. public function up()
  12. {
  13. $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="评论记录表"';
  14. $this->createTable('ats_comment', [
  15. 'id' => $this->primaryKey(),
  16. 'user_id'=>$this->integer(11)->defaultValue(null)->comment('用户id'),
  17. 'order_goods_id'=>$this->integer(11)->defaultValue(null)->comment('订单详情商品id'),
  18. 'star'=>$this->integer(11)->defaultValue(null)->comment('星级'),
  19. 'content'=>$this->text()->comment('评论内容'),
  20. 'status'=>$this->tinyInteger(1)->defaultValue(0)->comment('状态:1为显示,0为不显示'),
  21. 'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
  22. 'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
  23. ],$tableOptions);
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function down()
  29. {
  30. $this->dropTable('ats_comment');
  31. return true;
  32. }
  33. }