M250821030445InsertQimallAddonsCourseOrders.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace addons\Course\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250821030445InsertQimallAddonsCourseOrders
  6. */
  7. class M250821030445InsertQimallAddonsCourseOrders extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "ALTER TABLE `qimall_addons_course_orders`
  15. ADD COLUMN `refund_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '售后状态(0:未售后,1:售后中,2:退款完成)',
  16. ADD COLUMN `refund_at` int(11) NOT NULL DEFAULT 0 COMMENT '退款时间',
  17. ADD COLUMN `refund_desc` varchar(255) NULL COMMENT '退款原因';";
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M250821030445InsertQimallAddonsCourseOrders 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 "M250821030445InsertQimallAddonsCourseOrders cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }