M231229104415ReserveField.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M231229104415ReserveField
  6. */
  7. class M231229104415ReserveField extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("ALTER TABLE `qimall_order_refund` ADD COLUMN `goods_type` TINYINT NOT NULL DEFAULT 1 COMMENT '商品类型' AFTER `updated_at`;");
  15. $this->execute("INSERT INTO `qimall_link_category` (`name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES ('cate_goods', '类目商品', 7, 1, NULL, 1, 1634124003, 1634124003);");
  16. $this->execute("ALTER TABLE `qimall_goods` ADD COLUMN `comment_score` DECIMAL(5,2) NOT NULL DEFAULT '5' COMMENT '评分' AFTER `is_show`;");
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function safeDown()
  22. {
  23. echo "M231229104415ReserveField cannot be reverted.\n";
  24. return false;
  25. }
  26. /*
  27. // Use up()/down() to run migration code without a transaction.
  28. public function up()
  29. {
  30. }
  31. public function down()
  32. {
  33. echo "M231229104415ReserveField cannot be reverted.\n";
  34. return false;
  35. }
  36. */
  37. }