db->createCommand($sql)->execute(); if (!empty($res)) return ''; $sql = "CREATE TABLE `qimall_common_sync_logs` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `type` varchar(255) NOT NULL DEFAULT '' COMMENT '类型', `self_mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身商城ID', `source_mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '源商城ID', `type_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身商城的类型id', `source_type_id` int(11) NOT NULL DEFAULT '0' COMMENT '源商城的的类型id', `created_at` bigint(20) NOT NULL DEFAULT '0', `updated_at` bigint(20) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `idx_index` (`type`,`self_mall_id`,`source_mall_id`,`source_type_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商城公共信息同步日志表';"; $this->execute($sql); } catch (\Exception $e) { } } /** * {@inheritdoc} */ public function safeDown() { echo "M230531082246QimallGoodsServiceSyncLogs cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230531082246QimallGoodsServiceSyncLogs cannot be reverted.\n"; return false; } */ }