M250519013327CreateQimallAddonsScoreBonusCapitalPool.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace addons\ScoreBonus\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250519013327CreateQimallAddonsScoreBonusCapitalPool
  6. */
  7. class M250519013327CreateQimallAddonsScoreBonusCapitalPool extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql="CREATE TABLE `qimall_addons_score_bonus_capital_pool` (
  15. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  16. `mall_id` int(11) NOT NULL COMMENT '商城id',
  17. `bonus_price` decimal(14,2) NOT NULL COMMENT '当前分红池总额',
  18. `total_price` decimal(20,2) NOT NULL COMMENT '已发放分红总额',
  19. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
  20. `created_at` int(11) DEFAULT NULL COMMENT '添加时间',
  21. `updated_at` int(11) DEFAULT NULL COMMENT '修改时间',
  22. PRIMARY KEY (`id`)
  23. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分红池表';";
  24. $this->execute($sql);
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function safeDown()
  30. {
  31. echo "M250519013327CreateQimallAddonsScoreBonusCapitalPool cannot be reverted.\n";
  32. return false;
  33. }
  34. /*
  35. // Use up()/down() to run migration code without a transaction.
  36. public function up()
  37. {
  38. }
  39. public function down()
  40. {
  41. echo "M250519013327CreateQimallAddonsScoreBonusCapitalPool cannot be reverted.\n";
  42. return false;
  43. }
  44. */
  45. }