code: def does_schema_exist(self, connection):
          
  
          if '.' in self.table:
              query = ("select 1 as schema_exists "
                       "from pg_namespace "
                       "where nspname = lower(%s) limit 1")
          else:
              return True
  
          cursor = connection.cursor()
          try:
              schema = self.table.split('.')[0]
              cursor.execute(query, [schema])
              result = cursor.fetchone()
              return bool(result)
          finally:
              cursor.close()
docs: Determine whether the schema already exists.