M240828030707AlterQimallAddonsStoreCommission.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240828030707AlterQimallAddonsStoreCommission
  6. */
  7. class M240828030707AlterQimallAddonsStoreCommission extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("
  15. ALTER TABLE qimall_addons_store_commission add `amount_received_score` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '到账积分';
  16. ALTER TABLE qimall_addons_store_commission add `score_deduct_num` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '抵扣积分数量';");
  17. $this->execute("ALTER table qimall_addons_store_commission add score_deduction_bear tinyint(1) not null default -1 COMMENT '积分抵扣-优惠承担对象 -1:未开启积分抵扣;0:平台:1:门店'");
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M240828030707AlterQimallAddonsStoreCommission cannot be reverted.\n";
  25. return false;
  26. }
  27. /*
  28. // Use up()/down() to run migration code without a transaction.
  29. public function up()
  30. {
  31. }
  32. public function down()
  33. {
  34. echo "M240828030707AlterQimallAddonsStoreCommission cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }