diff --git a/django_extensions/management/commands/sqldiff.py b/django_extensions/management/commands/sqldiff.py
index <HASH>..<HASH> 100644
--- a/django_extensions/management/commands/sqldiff.py
+++ b/django_extensions/management/commands/sqldiff.py
@@ -49,15 +49,16 @@ def flatten(l, ltypes=(list, tuple)):
 
 def all_local_fields(meta):
     all_fields = []
-    if not meta.managed or meta.proxy:
-        for parent in meta.parents:
-            all_fields.extend(all_local_fields(parent._meta))
-    else:
-        for f in meta.local_fields:
-            col_type = f.db_type(connection=connection)
-            if col_type is None:
-                continue
-            all_fields.append(f)
+    if meta.managed:
+        if meta.proxy:
+            for parent in meta.parents:
+                all_fields.extend(all_local_fields(parent._meta))
+        else:
+            for f in meta.local_fields:
+                col_type = f.db_type(connection=connection)
+                if col_type is None:
+                    continue
+                all_fields.append(f)
     return all_fields
Not managed models should not return fields

Fixes previous commit where non-managed models were returning fields.