db->createCommand($sql)->execute(); if(!empty($res)) return ''; $sql=" CREATE TABLE `qimall_goods_association` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城id', `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品id', `extra1_goods_id` longtext COMMENT '关联配件商品id', `extra2_goods_id` longtext COMMENT '推荐商品商品id', `extra3_goods_id` longtext COMMENT '预留', `extra4_goods_id` longtext COMMENT '预留', `extra5_goods_id` longtext COMMENT '预留', `extra6_goods_id` longtext COMMENT '预留', `extra7_goods_id` longtext COMMENT '预留', `extra8_goods_id` longtext COMMENT '预留', `extra9_goods_id` longtext COMMENT '预留', `extra10_goods_id` longtext COMMENT '预留', `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]', `created_at` bigint(20) NOT NULL DEFAULT '0', `updated_at` bigint(20) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) USING BTREE, KEY `idx_goods_id` (`goods_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='关联商品'; "; $this->execute($sql); }catch (\Exception $e){ } } /** * {@inheritdoc} */ public function safeDown() { echo "M230525061728QimallGoodsAssociation cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230525061728QimallGoodsAssociation cannot be reverted.\n"; return false; } */ }