LocChat/server/database/cli_config.ts
2021-11-20 18:18:58 -07:00

23 lines
568 B
TypeScript

import '../env';
export = process.env.NODE_ENV === 'development'
? {
type: 'postgres',
host: 'localhost',
port: 5432,
database: process.env.DATABASE_URL,
autoLoadEntities: true,
migrations: ['server/database/migrations/*.ts'],
cli: {
migrationsDir: 'server/database/migrations',
},
}
: {
url: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: true },
migrations: ['server/database/migrations/*.ts'],
cli: {
migrationsDir: 'server/database/migrations',
},
};