M250623100431CreateScoreExpansionRecommendRewardDetailsTable.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace addons\ScoreExpansion\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles the creation of table `{{%score_expansion_recommend_reward_details}}`.
  6. */
  7. class M250623100431CreateScoreExpansionRecommendRewardDetailsTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_addons_score_expansion_recommend_reward_details` (
  16. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
  18. `recommend_reward_order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '推荐奖励订单记录表id',
  19. `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '发放用户ID',
  20. `date` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '奖励日期',
  21. `reward_frozen_score` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '奖励的冻结积分',
  22. `loop_num` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '第几轮的奖励',
  23. `current_reward_person_index` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '奖励第几人',
  24. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  25. `created_at` int(10) unsigned NOT NULL DEFAULT '0',
  26. `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
  27. PRIMARY KEY (`id`),
  28. KEY `recommend_reward_order_id` (`recommend_reward_order_id`)
  29. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='参与推荐奖励明细表';
  30. SQL;
  31. $this->execute($sql);
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function safeDown()
  37. {
  38. return false;
  39. }
  40. }