public function actionDrop()
    {
        $stdout = '';
        foreach ($this->db->schema->getTableSchemas() as $table) {
            if ($table->name === $this->migrationTable) {
                continue;
            }
            $stdout .= static::generateDropTable($table->name);
            if (!empty($table->foreignKeys)) {
                $stdout .= ' // fk: ';

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

                foreach ($table->foreignKeys as $fk) {
                    foreach ($fk as $k => $v) {
                        if (0 === $k) {
                            continue;
                        }
                        $stdout .= "$k, ";
                    }
                }
                $stdout = rtrim($stdout, ', ');
            }
            $stdout .= "\n";
        }
        $this->stdout($stdout);
    }
public function actionDrop ( ) { $ stdout = '' ; foreach ( $ this -> db -> schema -> getTableSchemas ( ) as $ table ) { if ( $ table -> name === $ this -> migrationTable ) { continue ; } $ stdout .= static :: generateDropTable ( $ table -> name ) ; if ( ! empty ( $ table -> foreignKeys ) ) { $ stdout .= ' // fk: ' ; foreach ( $ table -> foreignKeys as $ fk ) { foreach ( $ fk as $ k => $ v ) { if ( 0 === $ k ) { continue ; } $ stdout .= "$k, " ; } } $ stdout = rtrim ( $ stdout , ', ' ) ; } $ stdout .= "\n" ; } $ this -> stdout ( $ stdout ) ; }
Generates the 'dropTable' code.
@return integer the status of the action execution
Generates the dropTable code .