diff --git a/src/database/pg-wrapper.js b/src/database/pg-wrapper.js index 27bd385..c2982a1 100644 --- a/src/database/pg-wrapper.js +++ b/src/database/pg-wrapper.js @@ -28,8 +28,8 @@ const readWritePool = new Pool({ }); 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({ connectionString: readOnlyDatabaseURL, ssl: { @@ -169,6 +169,11 @@ export async function pgInitialize() { ); console.log("Create dashboard table and its index"); + await runPgCommand({ + command: dropTable("latest", "dashboards"), + pool: readWritePool, + }); + await runPgCommand({ command: buildDashboard(), pool: readWritePool,