<commit_before>(ns migrations.012-add-granule-index-with-revision-date
  (:require [clojure.java.jdbc :as j]
            [config.migrate-config :as config]
            [config.mdb-migrate-helper :as h]))

(defn up
  "Migrates the database up to version 12."
  []
  (println "migrations.012-add-granule-index-with-revision-date up...")
  (doseq [t (h/get-granule-tablenames)]
    (try
    	(h/sql (format "create index %s_crddr on %s (concept_id, revision_id, deleted, delete_time, revision_date)"
                   t t))
    	(h/sql "drop index crdi")
    (catch Exception e))))

(defn down
  "Migrates the database down from vedrsion 12."
  []
  (println "migrations.012-add-granule-index-with-revision-date down...")
  (doseq [t (h/get-granule-tablenames)]
    (h/sql (format "drop index %s_crddr" t))))<commit_msg>CMR-1294: Added table name to index in drop statement<commit_after>(ns migrations.012-add-granule-index-with-revision-date
  (:require [clojure.java.jdbc :as j]
            [config.migrate-config :as config]
            [config.mdb-migrate-helper :as h]))

(defn up
  "Migrates the database up to version 12."
  []
  (println "migrations.012-add-granule-index-with-revision-date up...")
  (doseq [t (h/get-granule-tablenames)]
    (try
    	(h/sql (format "create index %s_crddr on %s (concept_id, revision_id, deleted, delete_time, revision_date)"
                   t t))
    	(h/sql (format "drop index %s_crdi" t))
    (catch Exception e))))

(defn down
  "Migrates the database down from vedrsion 12."
  []
  (println "migrations.012-add-granule-index-with-revision-date down...")
  (doseq [t (h/get-granule-tablenames)]
    (h/sql (format "drop index %s_crddr" t))))
{'fraction_non_alphanumeric': 0.14852071005917158, 'fraction_numerical': 0.01775147928994083, 'mean_word_length': 3.0845410628019323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5529911', 'n_tokens_mistral': 658, 'n_tokens_neox': 626, 'n_words': 149}