Skip to content

Commit

Permalink
partitioning: make date-suffix return lower-case string
Browse files Browse the repository at this point in the history
postgres will coerce unquoted table names to lowercase, so have this
function return lowercase from the start
  • Loading branch information
austb committed Oct 17, 2024
1 parent 25e8e0f commit b7d2772
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/puppetlabs/puppetdb/scf/partitioning.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns puppetlabs.puppetdb.scf.partitioning
"Handles all work related to database table partitioning"
(:require
[clojure.string :refer [lower-case]]
[puppetlabs.i18n.core :refer [trs]]
[puppetlabs.puppetdb.jdbc :as jdbc]
[schema.core :as s])
Expand Down Expand Up @@ -32,8 +33,8 @@

(defn date-suffix
[date]
(let [formatter (.withZone (DateTimeFormatter/BASIC_ISO_DATE) (ZoneId/of "UTC"))]
(.format date formatter)))
(let [formatter (.withZone DateTimeFormatter/BASIC_ISO_DATE (ZoneId/of "UTC"))]
(lower-case (.format date formatter))))

(defn to-zoned-date-time
[date]
Expand Down

0 comments on commit b7d2772

Please sign in to comment.