<commit_before>(ns migrations.016-add-small-to-provider-table
  "Adds small field to provider table"
  (:require [clojure.java.jdbc :as j]
            [config.migrate-config :as config]
            [config.mdb-migrate-helper :as h]
            [cmr.metadata-db.data.oracle.concept-tables :as ct]))

(defn up
  "Migrates the database up to version 16."
  []
  (println "migrations.016-add-small-to-provider-table up...")
  (h/sql "alter table providers add small INTEGER DEFAULT 0 NOT NULL")
  ;; Create the SMALL_PROV tables and sequence
  ;; We use a dummy provider (the key is :small true) to invoke the create tables code.
  (let [db (config/db)]
    (ct/create-provider-concept-tables db {:provider-id "IGNORED"
                                           :cmr-only true
                                           :small true})))

(defn down
  "Migrates the database down from version 16."
  []
  (println "migrations.016-add-small-to-provider-table down...")
  ;; Drop the SMALL_PROV tables and sequence
  (let [db (config/db)]
    (ct/delete-provider-concept-tables db {:provider-id "IGNORED"<commit_msg>Fixed db migration issue in workload.<commit_after>(ns migrations.016-add-small-to-provider-table
  "Adds small field to provider table"
  (:require [clojure.java.jdbc :as j]
            [config.migrate-config :as config]
            [config.mdb-migrate-helper :as h]
            [cmr.metadata-db.data.oracle.concept-tables :as ct]))

(defn up
  "Migrates the database up to version 16."
  []
  (println "migrations.016-add-small-to-provider-table up...")
  (h/sql "alter table providers add small INTEGER DEFAULT 0 NOT NULL")
  ;; Create the SMALL_PROV tables and sequence
  ;; We use a dummy provider (the key is :small true) to invoke the create tables code.
  (let [db (config/db)]
    (ct/create-provider-concept-tables db {:provider-id "IGNORED"
                                           :short-name "IGNORED"
                                           :cmr-only true
                                           :small true})))

(defn down
  "Migrates the database down from version 16."
  []
  (println "migrations.016-add-small-to-provider-table down...")
  ;; Drop the SMALL_PROV tables and sequence
  (let [db (config/db)]
    (ct/delete-provider-concept-tables db {:provider-id "IGNORED"
                                           :short-name "IGNORED"
{'fraction_non_alphanumeric': 0.11593591905564925, 'fraction_numerical': 0.011804384485666104, 'mean_word_length': 2.2110960757780784, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4044544', 'n_tokens_mistral': 743, 'n_tokens_neox': 697, 'n_words': 212}