Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make disableMigration option handled by environment variable #8634

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib/create-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading