public function actionDrop($schema = '')
{
$stdout = '';
foreach ($this->db->schema->getTableSchemas($schema) as $table) {
if ($table->name === $this->migrationTable) {
continue;
}
$stdout .= "\$this->dropTable('{{%{$table->name}}}');";
if (!empty($table->foreignKeys)) {
$stdout .= " // fk: ";
foreach ($table->foreignKeys as $fk) {
foreach ($fk as $k => $v) {
if ($k === 0) {
continue;
}
$stdout .= "{$k}, ";
}
}
$stdout = rtrim($stdout, ', ');
}
$stdout .= "\n";
}
$this->stdout($stdout);
}