LocChat/server/database/cli_config.ts

28 lines
783 B
TypeScript
Raw Normal View History

2021-11-16 21:14:46 -05:00
import '../env';
export = process.env.NODE_ENV === 'development'
? {
type: 'postgres',
host: 'localhost',
port: 5432,
database: process.env.DATABASE_URL,
autoLoadEntities: true,
2021-11-20 20:18:58 -05:00
migrations: ['server/database/migrations/*.ts'],
2021-11-30 19:44:58 -05:00
seeds: ['server/database/seeds.ts'],
2021-11-16 21:14:46 -05:00
cli: {
2021-11-20 20:18:58 -05:00
migrationsDir: 'server/database/migrations',
2021-11-16 21:14:46 -05:00
},
2021-11-30 19:44:58 -05:00
entities: ['server/entities/**/*.entity.ts'],
2021-11-16 21:14:46 -05:00
}
: {
2021-12-04 22:57:25 -05:00
type: 'postgres',
2021-11-16 21:14:46 -05:00
url: process.env.DATABASE_URL,
2021-12-04 23:03:04 -05:00
ssl: { rejectUnauthorized: false },
2021-11-20 20:18:58 -05:00
migrations: ['server/database/migrations/*.ts'],
2021-11-30 19:44:58 -05:00
seeds: ['server/database/seeds.ts'],
2021-11-16 21:14:46 -05:00
cli: {
2021-11-20 20:18:58 -05:00
migrationsDir: 'server/database/migrations',
2021-11-16 21:14:46 -05:00
},
2021-11-30 19:44:58 -05:00
entities: ['server/entities/**/*.entity.ts'],
2021-11-16 21:14:46 -05:00
};