columnExists($tableName, $columnName)) { $sql = <<execute($sql); } } catch (\Exception $e) { } } protected function columnExists($tableName, $columnName): bool { $tableSchema = \Yii::$app->db->getTableSchema($tableName, true); return $tableSchema && in_array($columnName, $tableSchema->columnNames); } /** * {@inheritdoc} */ public function safeDown() { echo "M250825152436AddCommissionItemSettingDetail cannot be reverted.\n"; return false; } }