columnExists('qimall_addons_group_buy_active', 'restrict_rule_num')) { $sql = <<execute($sql); } }catch (\Exception $e) {} } /** * {@inheritdoc} */ public function safeDown() { return false; } protected function columnExists($tableName, $columnName) { $tableSchema = Yii::$app->db->getTableSchema($tableName, true); return $tableSchema && in_array($columnName, $tableSchema->columnNames); } }