From f9de10f64dd336fa3bec6b4d18dd18b79f52905f Mon Sep 17 00:00:00 2001 From: unimprobable <51294781+unimprobable@users.noreply.github.com> Date: Mon, 22 Feb 2021 08:32:23 -0500 Subject: [PATCH] added port config var to migrate-db.js and .env (#22395) Added port config variable to the migrate-db.js script and .env.local.example files. This allows users to set the port for remote databases like Digital Ocean that don't use the default port. --- examples/with-mysql/.env.local.example | 1 + examples/with-mysql/lib/db.ts | 1 + examples/with-mysql/scripts/migrate-db.js | 1 + 3 files changed, 3 insertions(+) diff --git a/examples/with-mysql/.env.local.example b/examples/with-mysql/.env.local.example index cf9f1b954e397..2062d45cde42c 100644 --- a/examples/with-mysql/.env.local.example +++ b/examples/with-mysql/.env.local.example @@ -4,3 +4,4 @@ MYSQL_HOST= MYSQL_DATABASE= MYSQL_USERNAME= MYSQL_PASSWORD= +MYSQL_PORT= diff --git a/examples/with-mysql/lib/db.ts b/examples/with-mysql/lib/db.ts index 13c458563f4a6..ede9544eca0f4 100644 --- a/examples/with-mysql/lib/db.ts +++ b/examples/with-mysql/lib/db.ts @@ -6,6 +6,7 @@ export const db = mysql({ database: process.env.MYSQL_DATABASE, user: process.env.MYSQL_USERNAME, password: process.env.MYSQL_PASSWORD, + port: process.env.MYSQL_PORT, }, }) diff --git a/examples/with-mysql/scripts/migrate-db.js b/examples/with-mysql/scripts/migrate-db.js index 022f0e1591528..66d529d7df6bc 100644 --- a/examples/with-mysql/scripts/migrate-db.js +++ b/examples/with-mysql/scripts/migrate-db.js @@ -13,6 +13,7 @@ const db = mysql({ database: process.env.MYSQL_DATABASE, user: process.env.MYSQL_USERNAME, password: process.env.MYSQL_PASSWORD, + port: process.env.MYSQL_PORT, }, })