title: Django makemigrations doesn't work with UndefinedColumn error
body: <p>This is what I got when I run makemigrations on python3.8 and django 3.2.12</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/home/ubuntu/.local/lib/python3.8/site-packages/django/db/backends/utils.py&quot;, line 82, in _execute
      return self.cursor.execute(sql)
  psycopg2.errors.UndefinedColumn: column &quot;type&quot; does not exist
  </code></pre>
  <p>I even tried cleaning up my db but still got this error. I have no idea what column &quot;type&quot; refers to. The message doesn't even tell which table it is from. And doesn't makemigrations not do anything with the db?</p>
  <p>I tried on my other projects and not facing this issue.</p>
  <p>Know what is the cause?</p>
  <p>This is the full traceback:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/utils.py&quot;, line 82, in _execute
      return self.cursor.execute(sql)
  psycopg2.errors.UndefinedColumn: column &quot;type&quot; does not exist
  </code></pre>
  <p>The above exception was the direct cause of the following exception:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;manage.py&quot;, line 21, in &lt;module&gt;
      main()
    File &quot;manage.py&quot;, line 17, in main
      execute_from_command_line(sys.argv)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/core/management/__init__.py&quot;, line 419, in execute_from_command_line
      utility.execute()
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/core/management/__init__.py&quot;, line 413, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/core/management/base.py&quot;, line 354, in run_from_argv
      self.execute(*args, **cmd_options)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/core/management/base.py&quot;, line 398, in execute
      output = self.handle(*args, **options)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/core/management/base.py&quot;, line 89, in wrapped
      res = handle_func(*args, **kwargs)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/core/management/commands/makemigrations.py&quot;, line 103, in handle
      loader.check_consistent_history(connection)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/migrations/loader.py&quot;, line 294, in check_consistent_history
      applied = recorder.applied_migrations()
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/migrations/recorder.py&quot;, line 77, in applied_migrations
      if self.has_table():
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/migrations/recorder.py&quot;, line 56, in has_table
      tables = self.connection.introspection.table_names(cursor)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/base/introspection.py&quot;, line 52, in table_names
      return get_names(cursor)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/base/introspection.py&quot;, line 47, in get_names
      return sorted(ti.name for ti in self.get_table_list(cursor)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django_cockroachdb/introspection.py&quot;, line 13, in get_table_list
      cursor.execute(&quot;SELECT table_name, type FROM [SHOW TABLES]&quot;)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/utils.py&quot;, line 98, in execute
      return super().execute(sql, params)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/utils.py&quot;, line 66, in execute
      return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/utils.py&quot;, line 75, in _execute_with_wrappers
      return executor(sql, params, many, context)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/utils.py&quot;, line 84, in _execute
      return self.cursor.execute(sql, params)
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/utils.py&quot;, line 90, in __exit__
      raise dj_exc_value.with_traceback(traceback) from exc_value
    File &quot;/home/yxzeng/.local/lib/python3.8/site-packages/django/db/backends/utils.py&quot;, line 82, in _execute
      return self.cursor.execute(sql)
  django.db.utils.ProgrammingError: column &quot;type&quot; does not exist
  </code></pre>
  <p>This even happens to my new built cockroachdb</p>