2022-02-03 17:06:44 +01:00
|
|
|
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
|
|
|
|
|
|
|
export const databaseConfig: TypeOrmModuleOptions = {
|
|
|
|
type: 'postgres',
|
2022-05-20 01:30:47 +02:00
|
|
|
host: process.env.DB_HOSTNAME || 'immich_postgres',
|
2022-02-03 17:06:44 +01:00
|
|
|
port: 5432,
|
|
|
|
username: process.env.DB_USERNAME,
|
|
|
|
password: process.env.DB_PASSWORD,
|
2022-02-03 21:42:27 +01:00
|
|
|
database: process.env.DB_DATABASE_NAME,
|
2022-02-03 17:06:44 +01:00
|
|
|
entities: [__dirname + '/../**/*.entity.{js,ts}'],
|
2022-02-20 05:42:10 +01:00
|
|
|
synchronize: false,
|
|
|
|
migrations: [__dirname + '/../migration/*.js'],
|
|
|
|
cli: {
|
|
|
|
migrationsDir: __dirname + '/../migration',
|
|
|
|
},
|
|
|
|
migrationsRun: true,
|
2022-02-03 17:06:44 +01:00
|
|
|
};
|