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.

33 lines
938 B

  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m191112_005545_create_table_collection
  5. */
  6. class m191112_005545_create_table_collection 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_collection', [
  15. 'id' => $this->primaryKey(),
  16. 'user_id'=>$this->integer(11)->defaultValue(null)->comment('用户id'),
  17. 'goods_id'=>$this->integer(11)->defaultValue(null)->comment('商品id'),
  18. 'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
  19. 'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
  20. ],$tableOptions);
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function down()
  26. {
  27. $this->dropTable('ats_collection');
  28. return true;
  29. }
  30. }