From 473724ff2be872167fffe5c8765c95b43399bea6 Mon Sep 17 00:00:00 2001 From: DiegoVictor Date: Tue, 18 Jun 2024 18:29:40 -0300 Subject: [PATCH] Get user and password to configure database URL --- src/migrations.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/migrations.js b/src/migrations.js index 9aba3e0..8485d4f 100644 --- a/src/migrations.js +++ b/src/migrations.js @@ -7,17 +7,14 @@ module.exports.handler = async () => { SecretId: process.env.CLUSTER_SECRET_ID, }); const { username, password } = JSON.parse(secret.SecretString); - console.log({ username, password }); - - // const DATABASE_URL = `postgresql://${username}:${password}@${process.env.DB_HOST}/coderunner?schema=public`; - // postgresql://app_user:P`ynjD)-[vYa!R1_2P3)D!QR1Z=t,H@coderunner-dbcluster.cluster-cqcxtxjpaiia.us-east-1.rds.amazonaws.com:5432/coderunner?schema=public + const DATABASE_URL = `postgresql://${username}:${password}@${process.env.CLUSTER_URL}/coderunner?schema=public`; const { output, error } = spawnSync( "./node_modules/.bin/prisma migrate deploy", { shell: true, env: { - DATABASE_URL: process.env.DATABASE_URL, + DATABASE_URL, }, } );