db->createCommand($sql)->execute(); if (!empty($res)) return ''; $sql = " CREATE TABLE `qimall_sync_goods_logs` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `self_mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身商城ID', `source_mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '源商城ID', `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '自身商城的商品id', `source_goods_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`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商城商品同步日志表';"; $this->execute($sql); } catch (\Exception $e) { } } /** * {@inheritdoc} */ public function safeDown() { echo "M230531060455QimallSyncGoodsLogs cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230531060455QimallSyncGoodsLogs cannot be reverted.\n"; return false; } */ }