M241011023444AlterQimallAddonsReservationServiceUser.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace addons\ReservationService\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241011023444AlterQimallAddonsReservationServiceUser
  6. */
  7. class M241011023444AlterQimallAddonsReservationServiceUser extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "
  15. alter table qimall_addons_reservation_service_user add `store_service_rating` decimal(3,2) NOT NULL DEFAULT '0' COMMENT '门店技师服务评分';
  16. ALTER TABLE qimall_addons_reservation_service_user ALTER COLUMN service_rating SET DEFAULT 0;
  17. alter table qimall_addons_reservation_service_user add `province` varchar(255) NOT NULL DEFAULT '' COMMENT '省';
  18. alter table qimall_addons_reservation_service_user add `city` varchar(255) NOT NULL DEFAULT '' COMMENT '市';
  19. alter table qimall_addons_reservation_service_user add `district` varchar(255) NOT NULL DEFAULT '' COMMENT '区';
  20. alter table qimall_addons_reservation_service_order add `reject_reason` varchar(255) NOT NULL DEFAULT '' COMMENT '拒绝理由';
  21. ";
  22. $this->execute($sql);
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function safeDown()
  28. {
  29. echo "M241011023444AlterQimallAddonsReservationServiceUser cannot be reverted.\n";
  30. return false;
  31. }
  32. /*
  33. // Use up()/down() to run migration code without a transaction.
  34. public function up()
  35. {
  36. }
  37. public function down()
  38. {
  39. echo "M241011023444AlterQimallAddonsReservationServiceUser cannot be reverted.\n";
  40. return false;
  41. }
  42. */
  43. }