M240923080811CreateOrderModifyShippingAddressLogTable.php 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles the creation of table `{{%order_modify_shipping_address_log}}`.
  6. */
  7. class M240923080811CreateOrderModifyShippingAddressLogTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_order_modify_shipping_address_log` (
  16. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
  18. `order_id` int(10) unsigned NOT NULL DEFAULT '0',
  19. `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '-1删除 1禁用 2正常',
  20. `created_at` int(10) unsigned NOT NULL DEFAULT '0',
  21. `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
  22. PRIMARY KEY (`id`),
  23. KEY `mall_id+order_id+status` (`mall_id`,`order_id`,`status`) USING BTREE
  24. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  25. SQL;
  26. $this->execute($sql);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. return false;
  34. }
  35. }