protected function dropTables()
    {
        $tables = $this->db->query(
            'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "BASE_TABLE"',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        // Disable foreign key checks -- we are wiping the database on purpose
        $this->db->query(
            'SET FOREIGN_KEY_CHECKS = 0',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        foreach ($tables as $table) {
            $this->db->query(
                'DROP TABLE '.reset($table),
                DbAdapter::QUERY_MODE_EXECUTE
            );
        }

        // Re-enable foreign key checks
        $this->db->query(
            'SET FOREIGN_KEY_CHECKS = 1',
            DbAdapter::QUERY_MODE_EXECUTE
        );
    }
protected function dropTables()
    {
        $tables = $this->db->query(
            'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "BASE_TABLE"',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        // Disable foreign key checks -- we are wiping the database on purpose
        $this->db->query(
            'SET FOREIGN_KEY_CHECKS = 0',
            DbAdapter::QUERY_MODE_EXECUTE
        );

        foreach ($tables as $table) {
            $this->db->query(
                'DROP TABLE '.reset($table),
                DbAdapter::QUERY_MODE_EXECUTE
            );
        }

        // Re-enable foreign key checks
        $this->db->query(
            'SET FOREIGN_KEY_CHECKS = 1',
            DbAdapter::QUERY_MODE_EXECUTE
        );
    }
protected function dropTables ( ) { $ tables = $ this -> db -> query ( 'SHOW FULL TABLES WHERE TABLE_TYPE LIKE "BASE_TABLE"' , DbAdapter :: QUERY_MODE_EXECUTE ) ; // Disable foreign key checks -- we are wiping the database on purpose $ this -> db -> query ( 'SET FOREIGN_KEY_CHECKS = 0' , DbAdapter :: QUERY_MODE_EXECUTE ) ; foreach ( $ tables as $ table ) { $ this -> db -> query ( 'DROP TABLE ' . reset ( $ table ) , DbAdapter :: QUERY_MODE_EXECUTE ) ; } // Re-enable foreign key checks $ this -> db -> query ( 'SET FOREIGN_KEY_CHECKS = 1' , DbAdapter :: QUERY_MODE_EXECUTE ) ; }
Drop all tables from the database
Drop all tables from the database