diff --git a/doc/environment.md b/doc/environment.md index f7904a2..7aa2c55 100644 --- a/doc/environment.md +++ b/doc/environment.md @@ -21,8 +21,9 @@ | Name | Default Value | Description | | ---- | ------------- | ----------- | -| DB_URI | `sqlite://data.sqlite` | url in the format `TYPE://USER:PASS@HOST:PORT/NAME?EXTRA` ([read more](https://typeorm.io/#/connection-options/common-connection-options)) | -| DB_TABLE_PREFIX | *empty* | prefix all tables if used within same database as other applications. | -| DB_LOGGING | `false` | if `true` all db interactions will be logged to stdout | -| DB_MIGRATE | `true` | can be used in load balanced environments to only allow one container to perform migrations / manually execute migrations +| DATABASE_DRIVER | `sqlite` | database driver, either `sqlite` or `postgres` | +| DATABASE_URL | `sqlite://data.sqlite` | url in the format `TYPE://USER:PASS@HOST:PORT/NAME?EXTRA` ([read more](https://typeorm.io/#/connection-options/common-connection-options)) | +| DATABASE_TABLE_PREFIX | *empty* | prefix all tables if used within same database as other applications. | +| DATABASE_LOGGING | `false` | if `true` all db interactions will be logged to stdout | +| DATABASE_MIGRATE | `true` | can be used in load balanced environments to only allow one container to perform migrations / manually execute migrations diff --git a/src/app.imports.ts b/src/app.imports.ts index df01f00..429a100 100644 --- a/src/app.imports.ts +++ b/src/app.imports.ts @@ -108,15 +108,15 @@ export const imports = [ useFactory: (configService: ConfigService): TypeOrmModuleOptions => ({ name: 'ohmyform', synchronize: false, - type: configService.get('DB_TYPE', 'sqlite') as any, - url: configService.get('DB_URI', 'sqlite://data.sqlite'), - entityPrefix: configService.get('DB_TABLE_PREFIX', ''), - logging: configService.get('DB_LOGGING', 'false') === 'true', + type: configService.get('DATABASE_DRIVER', 'sqlite') as any, + url: configService.get('DATABASE_URL', 'sqlite://data.sqlite'), + entityPrefix: configService.get('DATABASE_TABLE_PREFIX', ''), + logging: configService.get('DATABASE_LOGGING', 'false') === 'true', entities, migrations: [ `${__dirname}/**/migrations/**/*{.ts,.js}`, ], - migrationsRun: configService.get('DB_MIGRATE', true), + migrationsRun: configService.get('DATABASE_MIGRATE', true), }), }), TypeOrmModule.forFeature(entities),