M250623081811CreateScoreExpansionRecommendRewardGoodsTable.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace addons\ScoreExpansion\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles the creation of table `{{%score_expansion_recommend_reward_goods}}`.
  6. */
  7. class M250623081811CreateScoreExpansionRecommendRewardGoodsTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_addons_score_expansion_recommend_reward_goods` (
  16. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',
  18. `goods_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID',
  19. `is_alone` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否独立设置',
  20. `setting` json DEFAULT NULL COMMENT '独立设置',
  21. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  22. `created_at` int(10) unsigned NOT NULL DEFAULT '0',
  23. `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
  24. PRIMARY KEY (`id`),
  25. KEY `goods_id` (`goods_id`)
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='参与推荐奖励的商品表';
  27. SQL;
  28. $this->execute($sql);
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function safeDown()
  34. {
  35. return false;
  36. }
  37. }