Skip to content

Commit

Permalink
Get user and password to configure database URL
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoVictor committed Jun 18, 2024
1 parent 4949aa2 commit 473724f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
);
Expand Down

0 comments on commit 473724f

Please sign in to comment.