mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
feat: Make disableMigration
option handled by environment variable (#8634)
In some cases, people want to disable database migration. For example, some people or companies want to grant whole permissions to handle the schema by DBAs, not by application level hence I use `parseEnvVarBoolean` to handle `disableMigration` option by environment variable. I set the default value as `false` for the backward compatibility.
This commit is contained in:
parent
b5a2befec7
commit
ef8417a08d
@ -259,7 +259,10 @@ const defaultDbOptions: WithOptional<IDBOption, 'user' | 'password' | 'host'> =
|
||||
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',
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user