code: def field_exists(app_name, model_name, field_name):
      
      model = apps.get_model(app_name, model_name)
      table_name = model._meta.db_table
      cursor = connection.cursor()
      field_info = connection.introspection.get_table_description(cursor, table_name)
      field_names = [f.name for f in field_info]
      return field_name in field_names
docs: Does the FK or M2M table exist in the database already?