M250212063533CreateCloudStockAgentOrderRefundTable.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace addons\CloudStock\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles the creation of table `{{%cloud_stock_agent_order_refund}}`.
  6. */
  7. class M250212063533CreateCloudStockAgentOrderRefundTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_addons_cloud_stock_agent_order_refund` (
  16. `id` int UNSIGNED NOT NULL AUTO_INCREMENT,
  17. `mall_id` int UNSIGNED NOT NULL DEFAULT 0,
  18. `order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '自提订单id',
  19. `order_type` tinyint(3) unsigned DEFAULT '0' COMMENT '退款订单类型',
  20. `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  21. `order_no` varchar(255) NOT NULL DEFAULT '' COMMENT '退款编号',
  22. `status` tinyint NOT NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
  23. `is_refund` tinyint NOT NULL DEFAULT 0 COMMENT '是否已打款',
  24. `refund_at` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '打款时间',
  25. `refund_price` decimal(12, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '退款金额',
  26. `reality_refund_price` decimal(12, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '实际退款金额',
  27. `created_at` int UNSIGNED NOT NULL DEFAULT 0,
  28. `updated_at` int UNSIGNED NOT NULL DEFAULT 0,
  29. PRIMARY KEY (`id`)
  30. );
  31. SQL;
  32. $this->execute($sql);
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function safeDown()
  38. {
  39. return false;
  40. }
  41. }