Skip to content

Commit

Permalink
elevation db was not being replaced properly in connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
amyfromandi committed Sep 25, 2024
1 parent 04a4bd3 commit 58014c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion v2/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (process.env.MACROSTRAT_DB_URL != null && process.env.MACROSTRAT_DATABASE ==
if (process.env.MACROSTRAT_DATABASE != null) {
// Connect using a database URL
const macrostratDatabaseURL = process.env.MACROSTRAT_DATABASE
const elevationDatabaseURL = process.env.ELEVATION_DATABASE ?? macrostratDatabaseURL.replace("/macrostrat", "/elevation");
const elevationDatabaseURL = process.env.ELEVATION_DATABASE ?? macrostratDatabaseURL.replace("5432/macrostrat", "5432/elevation");
exports.pg = {
macrostratDatabaseURL,
elevationDatabaseURL
Expand Down
1 change: 1 addition & 0 deletions v2/larkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const { Client, Pool } = require("pg");
let connectionDetails;

const postgresCfg = credentials.pg;
console.log(postgresCfg.elevationDatabaseURL)

const inURLMode = postgresCfg.macrostratDatabaseURL != null;
if (inURLMode) {
Expand Down

0 comments on commit 58014c4

Please sign in to comment.