Closed kimkimani closed 5 months ago
@kimkimani i'm not familiar with nest.js. Can you provide a reproduction repo for testing ?
I'm using this package with Nest.js. What is not working on your end?
@kimkimani please reopen the issue, if you still have problems setting everything up.
@SebiBasti could u provide your config files? to make it work
@SebiBasti could u provide your config files? to make it work
const config = {
type: 'postgres',
host: process.env.DATABASE_HOST,
port: parsePort(5432, process.env.DATABASE_PORT),
username: process.env.DATABASE_USERNAME || 'postgres',
password: process.env.DATABASE_PASSWORD || 'postgres',
database: process.env.DATABASE_NAME || 'nestbackend',
entities: [__dirname + '/../**/*.entity.{js,ts}'],
migrations: [__dirname + '/../database/migrations/*.{js,ts}'],
autoLoadEntities: true,
synchronize: false,
logging: process.env.NODE_ENV === 'development' ? 'all' : true,
logger: logger // custom logger
}
export default registerAs('typeorm', () => config)
export const connectionSource = new DataSource(config as PostgresConnectionOptions)
We are not using synchronize: true
but migration files.
I used this link as inspiration: https://dev.to/amirfakour/using-typeorm-migration-in-nestjs-with-postgres-database-3c75
💚