db->getTableSchema($tableName, true); $column_cate_ids = $table->getColumn('cate_ids'); $column_buy_cate_type = $table->getColumn('buy_cate_type'); if(!$column_cate_ids){ $this->execute("ALTER TABLE qimall_user_level_upgrade_condition add `cate_ids` varchar(3000) NOT NULL DEFAULT '' COMMENT '商品分类id集合'"); } if(!$column_buy_cate_type){ $this->execute("ALTER TABLE qimall_user_level_upgrade_condition add `buy_cate_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单完成0;支付完成:1';"); } } /** * {@inheritdoc} */ public function safeDown() { echo "m220830_025931_user_level_upgrade_condition cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "m220830_025931_user_level_upgrade_condition cannot be reverted.\n"; return false; } */ }