| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M240514111323AddPickupTable
- */
- class M240514111323AddPickupTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_addons_store_order_pickup` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) NOT NULL,
- `store_id` int(10) NOT NULL COMMENT '门店ID',
- `order_id` int(10) NOT NULL COMMENT '门店订单ID',
- `mall_order_id` int(10) NOT NULL COMMENT '主商城订单ID',
- `stage` int(10) NOT NULL COMMENT '期数',
- `code` varchar(10) NOT NULL COMMENT '自提码',
- `updated_at` int(10) DEFAULT NULL,
- `created_at` int(10) DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `store_id` (`store_id`),
- KEY `order_id` (`order_id`),
- KEY `stage` (`stage`),
- KEY `mall_order_id` (`mall_order_id`)
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='订单自提码';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M240514111323AddPickupTable cannot be reverted.\n";
- return false;
- }
- }
|