 (defn- delete-collection-granules-sql
   "Generate SQL to delete granules for a given collection from a provider's granule table."
   [provider-id collection-id]
-  (let [granule-table (keyword (str metadata-db-tablespace "." provider-id "-granules"))]
+  (let [granule-table (tables/get-table-name provider-id :granule)]
     (su/build (delete granule-table (where `(= :parent-collection-id ~collection-id))))))
 
 (defn- delete-collection-granules

            [sqlingvo.vendor :as v]
            [cmr.metadata-db.data.oracle.sql-utils :as su]
            [clojure.core.async :as ca :refer [thread alts!! <!!]]
            [cmr.oracle.connection :as oc]))

;; To copy a provider
;; 1. Tell the metadata db to drop the provider

(defn- delete-collection-sql
  "Generate SQL to delete a collection from a provider's collection table."
  [provider-id collection-id]
  (let [collection-table (tables/get-table-name provider-id :collection)]
    (su/build (delete collection-table (where `(= :concept-id ~collection-id))))))

(defn- delete-collection
