M240517034738CreateRebateVirtualOrderLog.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace addons\Rebate\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240517034738CreateRebateVirtualOrderLog
  6. */
  7. class M240517034738CreateRebateVirtualOrderLog extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<CREATETABLE
  15. CREATE TABLE `qimall_addons_rebate_virtual_order_log` (
  16. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '生成虚拟订单的用户id',
  18. `mall_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商城id',
  19. `user_parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '虚拟订单用户的父id',
  20. `rebate_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '推三返一活动id qimall_addons_rebate表',
  21. `rebate_buy_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '推三返一活动用户购买表id qimall_addons_rebate_buy表',
  22. `created_at` bigint(20) unsigned NOT NULL DEFAULT '0',
  23. `updated_at` bigint(20) unsigned NOT NULL DEFAULT '0',
  24. PRIMARY KEY (`id`)
  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='推三返一生成虚拟订单记录表';
  26. CREATETABLE;
  27. $this->execute($sql);
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function safeDown()
  33. {
  34. }
  35. /*
  36. // Use up()/down() to run migration code without a transaction.
  37. public function up()
  38. {
  39. }
  40. public function down()
  41. {
  42. echo "M240517034738CreateRebateVirtualOrderLog cannot be reverted.\n";
  43. return false;
  44. }
  45. */
  46. }