M240827033941CreatebackendDeductqimallGlobalVarMap.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240827033941CreatebackendDeductqimallGlobalVarMap
  6. */
  7. class M240827033941CreatebackendDeductqimallGlobalVarMap extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("INSERT INTO `qimall_global_var_map` (`name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ('backend_deduct', '后台扣减', 'CapitalTypeMap', 0, 1, 1654569888, 1654569888);");
  15. $this->execute("ALTER TABLE `qimall_goods`
  16. ADD COLUMN `can_feedback` TINYINT(4) NOT NULL DEFAULT 1 COMMENT '是否可以申请售后';");
  17. $this->execute("ALTER TABLE `qimall_order_refund`
  18. ADD COLUMN `num` INT(10) NOT NULL DEFAULT '0' COMMENT '售后数量';");
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M240827033941CreatebackendDeductqimallGlobalVarMap cannot be reverted.\n";
  26. return false;
  27. }
  28. /*
  29. // Use up()/down() to run migration code without a transaction.
  30. public function up()
  31. {
  32. }
  33. public function down()
  34. {
  35. echo "M240827033941CreatebackendDeductqimallGlobalVarMap cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }