From 35d888aaafa1d00341f9e77856e3428480bb1aeb Mon Sep 17 00:00:00 2001 From: Taehyun Lee <0417taehyun@gmail.com> Date: Mon, 4 Nov 2024 10:53:58 +0900 Subject: [PATCH 1/3] Make disableMigration to be handled by environment variable --- src/lib/create-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/create-config.ts b/src/lib/create-config.ts index 5e2951c48dd3..35980b6274cc 100644 --- a/src/lib/create-config.ts +++ b/src/lib/create-config.ts @@ -259,7 +259,7 @@ const defaultDbOptions: WithOptional = propagateCreateError: false, }, schema: process.env.DATABASE_SCHEMA || 'public', - disableMigration: false, + disableMigration: parseEnvVarBoolean(process.env.DATABASE_DISABLE_MIGRATION, false), applicationName: process.env.DATABASE_APPLICATION_NAME || 'unleash', }; From 74e1b17f969cf1a4f79dc5bfc32b82e87095f1ad Mon Sep 17 00:00:00 2001 From: Taehyun Lee <0417taehyun@gmail.com> Date: Mon, 4 Nov 2024 10:54:47 +0900 Subject: [PATCH 2/3] Add description of disableMigration option in document --- website/docs/using-unleash/deploy/configuring-unleash.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/using-unleash/deploy/configuring-unleash.mdx b/website/docs/using-unleash/deploy/configuring-unleash.mdx index b087d05329aa..aff97d0a6227 100644 --- a/website/docs/using-unleash/deploy/configuring-unleash.mdx +++ b/website/docs/using-unleash/deploy/configuring-unleash.mdx @@ -383,6 +383,7 @@ Unleash options' `db` object. | `pool.idleTimeoutMillis` | `DATABASE_POOL_IDLE_TIMEOUT_MS` | 30000 | The amount of time (in milliseconds) that a connection must be idle for before it is marked as a candidate for eviction. | | `applicationName` | `DATABASE_APPLICATION_NAME` | `unleash` | The name of the application that created this Client instance. | | `schema` | `DATABASE_SCHEMA` | `public` | The schema to use in the database. | +| `disableMigration` | `DATABASE_DISABLE_MIGRATION` | false | The option not to use database migration. | Alternatively, you can use a single-host [libpq connection string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) to From 3927793f50e8488661dd9032cab2ddd473ca5008 Mon Sep 17 00:00:00 2001 From: Taehyun Lee <0417taehyun@gmail.com> Date: Tue, 5 Nov 2024 19:03:45 +0900 Subject: [PATCH 3/3] Apply lint --- src/lib/create-config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/create-config.ts b/src/lib/create-config.ts index 35980b6274cc..e3c386d3d01c 100644 --- a/src/lib/create-config.ts +++ b/src/lib/create-config.ts @@ -259,7 +259,10 @@ const defaultDbOptions: WithOptional = propagateCreateError: false, }, schema: process.env.DATABASE_SCHEMA || 'public', - disableMigration: parseEnvVarBoolean(process.env.DATABASE_DISABLE_MIGRATION, false), + disableMigration: parseEnvVarBoolean( + process.env.DATABASE_DISABLE_MIGRATION, + false, + ), applicationName: process.env.DATABASE_APPLICATION_NAME || 'unleash', };