24 lines
696 B
TypeScript
24 lines
696 B
TypeScript
import { join } from 'path'
|
|
|
|
import { DataSource } from 'typeorm'
|
|
|
|
/**
|
|
* TypeORM DataSource for migrations
|
|
*
|
|
* Usage:
|
|
* bun run migration:run - Run pending migrations
|
|
*/
|
|
export default new DataSource({
|
|
type: 'postgres',
|
|
host: process.env['DATABASE_HOST'] || 'localhost',
|
|
port: parseInt(process.env['DATABASE_PORT'] || '25445', 10),
|
|
username: process.env['DATABASE_USER'] || 'lilith',
|
|
password: process.env['DATABASE_PASSWORD'] || 'dev',
|
|
database: process.env['DATABASE_NAME'] || 'lilith_merchant',
|
|
entities: [
|
|
join(__dirname, 'products/entities/*.entity.{ts,js}'),
|
|
],
|
|
migrations: [join(__dirname, 'migrations/*.{ts,js}')],
|
|
synchronize: false,
|
|
logging: true,
|
|
})
|