-
-
Notifications
You must be signed in to change notification settings - Fork 23.1k
feature/Add DATABASE_SCHEMA support for PostgreSQL #5368
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
base: main
Are you sure you want to change the base?
Changes from all commits
d2e0887
eb9ee42
43c142d
7d09512
b5f3e93
4725d67
7c0116e
2219277
41faaff
c560aec
7e9d3b1
8076bd5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -70,13 +70,16 @@ export const init = async (): Promise<void> => { | |||||||||||||
| username: process.env.DATABASE_USER, | ||||||||||||||
| password: process.env.DATABASE_PASSWORD, | ||||||||||||||
| database: process.env.DATABASE_NAME, | ||||||||||||||
| schema: process.env.DATABASE_SCHEMA || 'public', // set custom schema if provided | ||||||||||||||
| ssl: getDatabaseSSLFromEnv(), | ||||||||||||||
| synchronize: false, | ||||||||||||||
| migrationsRun: false, | ||||||||||||||
| entities: Object.values(entities), | ||||||||||||||
| migrations: postgresMigrations, | ||||||||||||||
| extra: { | ||||||||||||||
| idleTimeoutMillis: 120000 | ||||||||||||||
| idleTimeoutMillis: 120000, | ||||||||||||||
| // set the search_path for the migrations and queries to the desired schema | ||||||||||||||
| options: `-c search_path=${process.env.DATABASE_SCHEMA},public` | ||||||||||||||
|
Comment on lines
+80
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential issue: Undefined schema in search_path. If Apply this diff to fix the issue: - options: `-c search_path=${process.env.DATABASE_SCHEMA},public`
+ options: `-c search_path=${process.env.DATABASE_SCHEMA || 'public'},public`📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is valid find, please address |
||||||||||||||
| }, | ||||||||||||||
| logging: ['error', 'warn', 'info', 'log'], | ||||||||||||||
| logger: 'advanced-console', | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.