Skip to content

Conversation

@azoz-w
Copy link

@azoz-w azoz-w commented Oct 25, 2025

This PR adds support for the DATABASE_SCHEMA environment variable. This allows users to specify a default schema when using a PostgreSQL database, which is necessary for multi-schema environments.

@azoz-w azoz-w changed the title feat: Add DATABASE_SCHEMA support for PostgreSQL feature/Add DATABASE_SCHEMA support for PostgreSQL Oct 25, 2025
migrationsRun: false,
entities: Object.values(entities),
migrations: postgresMigrations,
migrationsTableName: 'migrations',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary? can we use the default table name instead of hardcoding migrations as the table name

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, im just completing the change as it seems a bit more larger. And ill refactor it better.

Thanks for the comment

})
break
case 'postgres':
const dbSchema = process.env.DATABASE_SCHEMA
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to wrap these in curly brackets if using const

@HenryHengZJ
Copy link
Contributor

also if you can give a couple of screenshots to make sure this works, that'd be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants