| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250114104035AddStoreLoseEffectOrderTable
- */
- class M250114104035AddStoreLoseEffectOrderTable extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- CREATE TABLE `qimall_addons_store_lose_order` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '流失的门店user_id',
- `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单id,store_order表id',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:-1删除,0禁用,1正常',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `idx_muo` (`mall_id`,`user_id`,`order_id`) USING BTREE
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='门店入驻限制-流失订单';
- CREATE TABLE `qimall_addons_store_effect_order` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(11) NOT NULL DEFAULT '0',
- `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
- `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单id,store_order表的user_id',
- `store_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店用户id',
- `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单id,store_order表的id',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,-1删除,0禁用,1正常',
- `created_at` int(11) NOT NULL DEFAULT '0',
- `updated_at` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `idx_mus` (`mall_id`,`user_id`,`store_user_id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='门店入驻限制-门店有效订单';
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250114104035AddStoreLoseEffectOrderTable cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250114104035AddStoreLoseEffectOrderTable cannot be reverted.\n";
- return false;
- }
- */
- }
|