M240624091149CreateQimallAddonsScoreBonusCapital.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace addons\ScoreBonus\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240624091149CreateQimallAddonsScoreBonusCapital
  6. */
  7. class M240624091149CreateQimallAddonsScoreBonusCapital extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("CREATE TABLE `qimall_addons_score_bonus_capital` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  16. `mall_id` int(11) NOT NULL COMMENT '商城id',
  17. `order_id` int(11) NOT NULL COMMENT '订单id',
  18. `goods_price` decimal(19,2) DEFAULT NULL COMMENT '订单营业额',
  19. `bonus_pre` int(3) DEFAULT NULL COMMENT '订单投入资金池的比例, 单位%',
  20. `bonus_price` decimal(19,2) DEFAULT NULL COMMENT '投入资金池的金额',
  21. `status` tinyint(1) DEFAULT NULL COMMENT '状态[-1:删除;0:禁用;1启用]',
  22. `created_at` int(11) DEFAULT NULL COMMENT '创建时间',
  23. `updated_at` int(11) DEFAULT NULL COMMENT '修改时间',
  24. `date_time` int(11) DEFAULT NULL COMMENT '所属日期',
  25. PRIMARY KEY (`id`)
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分分红资金池数据表'");
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. echo "M240624091149CreateQimallAddonsScoreBonusCapital cannot be reverted.\n";
  34. return false;
  35. }
  36. /*
  37. // Use up()/down() to run migration code without a transaction.
  38. public function up()
  39. {
  40. }
  41. public function down()
  42. {
  43. echo "M240624091149CreateQimallAddonsScoreBonusCapital cannot be reverted.\n";
  44. return false;
  45. }
  46. */
  47. }