M250304093733CreateOrderSettlementLogByDev106.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace addons\Area\console\migrations;
  3. use addons\Area\common\models\AreaOrderSettlementLog;
  4. use common\enums\RabbitMqEnum;
  5. use Yii;
  6. use yii\db\Migration;
  7. /**
  8. * Class M250304093733CreateOrderSettlementLogByDev106
  9. */
  10. class M250304093733CreateOrderSettlementLogByDev106 extends Migration
  11. {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public function safeUp()
  16. {
  17. $sql = <<<SQL
  18. CREATE TABLE `qimall_addons_area_order_settlement_log` (
  19. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  20. `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
  21. `status` tinyint(4) NOT NULL DEFAULT '1',
  22. `order_id` int(10) unsigned NOT NULL DEFAULT '0',
  23. `created_at` int(10) unsigned NOT NULL DEFAULT '0',
  24. `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
  25. PRIMARY KEY (`id`),
  26. KEY `mall_id+status+order_id` (`mall_id`,`status`,`order_id`)
  27. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='记录已结算的订单';
  28. SQL;
  29. $this->execute($sql);
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function safeDown()
  35. {
  36. return false;
  37. }
  38. /*
  39. // Use up()/down() to run migration code without a transaction.
  40. public function up()
  41. {
  42. }
  43. public function down()
  44. {
  45. echo "M250304093733CreateOrderSettlementLogByDev106 cannot be reverted.\n";
  46. return false;
  47. }
  48. */
  49. }