fix: pg url

This commit is contained in:
NunoSempere 2022-02-26 13:36:19 -05:00
parent 752a5b2cfe
commit 83e50e7349

View File

@ -28,8 +28,8 @@ const readWritePool = new Pool({
}); });
const readOnlyDatabaseURL = const readOnlyDatabaseURL =
getSecret("digitalocean-postgres-public") || "postgresql://public_read_only_user:gOcihnLhqRIQUQYt@postgres-red-do-user-10290909-0.b.db.ondigitalocean.com:25060/metaforecastpg?sslmode=require" ||
"postgresql://public_read_only_user:gOcihnLhqRIQUQYt@postgres-red-do-user-10290909-0.b.db.ondigitalocean.com:25060/metaforecastpg?sslmode=require"; getSecret("digitalocean-postgres-public");
const readOnlyPool = new Pool({ const readOnlyPool = new Pool({
connectionString: readOnlyDatabaseURL, connectionString: readOnlyDatabaseURL,
ssl: { ssl: {
@ -169,6 +169,11 @@ export async function pgInitialize() {
); );
console.log("Create dashboard table and its index"); console.log("Create dashboard table and its index");
await runPgCommand({
command: dropTable("latest", "dashboards"),
pool: readWritePool,
});
await runPgCommand({ await runPgCommand({
command: buildDashboard(), command: buildDashboard(),
pool: readWritePool, pool: readWritePool,