M250711065137CreateOrderPrescriptionDetailsTable.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles the creation of table `{{%order_prescription_details}}`.
  6. */
  7. class M250711065137CreateOrderPrescriptionDetailsTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_order_prescription_details` (
  16. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
  18. `user_id` int(10) unsigned NOT NULL DEFAULT '0',
  19. `order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  20. `symptom` json DEFAULT NULL COMMENT '下单选择的症状',
  21. `prescription_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '开方状态 (-1 开方失败 0: 未开方 1: 已开方)',
  22. `prescription_err_msg` varchar(100) NOT NULL DEFAULT '' COMMENT '开方失败消息',
  23. `img_url` varchar(255) NOT NULL DEFAULT '' COMMENT '处方图片url',
  24. `medication_recipient` json DEFAULT NULL COMMENT '处方人信息',
  25. `audit_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '审核状态 -1审核不通过 0待审核 1待复核 2已核发',
  26. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1删除,0禁用,1正常]',
  27. `created_at` int(10) unsigned NOT NULL DEFAULT '0',
  28. `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
  29. PRIMARY KEY (`id`),
  30. KEY `order_id` (`order_id`)
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='处方药商品订单信息表';
  32. SQL;
  33. $this->execute($sql);
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function safeDown()
  39. {
  40. return false;
  41. }
  42. }