From a2087d9c2a2a403ee9b464360e7cec2b41a5ef4e Mon Sep 17 00:00:00 2001 From: Edgar Sargsyan <92edgarsargsyan@gmail.com> Date: Sun, 5 Feb 2023 02:20:59 +0400 Subject: [PATCH] feat: add default db configs for github actions --- config/database.ts | 10 +++++----- ormconfig.json | 22 ---------------------- 2 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 ormconfig.json diff --git a/config/database.ts b/config/database.ts index 27c88e6..4fa8c15 100644 --- a/config/database.ts +++ b/config/database.ts @@ -2,11 +2,11 @@ import { join } from 'path'; export default { name: process.env.TYPEORM_DATABASE, - type: 'mysql', - host: process.env.TYPEORM_HOST, - username: process.env.TYPEORM_USERNAME, - password: process.env.TYPEORM_PASSWORD, - database: process.env.TYPEORM_DATABASE, + type: process.env.TYPEORM_TYPE || 'mariadb', + host: process.env.TYPEORM_HOST || 'localhost', + username: process.env.TYPEORM_USERNAME || 'guest', + password: process.env.TYPEORM_PASSWORD || 'guest', + database: process.env.TYPEORM_DATABASE || 'core', port: parseInt(process.env.TYPEORM_PORT) || 3306, logging: process.env.TYPEORM_LOGGING === 'true', entities: [join(__dirname, '..', '**', '*.entity.{ts,js}')], diff --git a/ormconfig.json b/ormconfig.json deleted file mode 100644 index 94a2aab..0000000 --- a/ormconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "default", - "type": "mariadb", - "host": "localhost", - "username": "guest", - "password": "guest", - "database": "core", - "port": 3306, - "logging": true, - "entities": [ - "src/**/*.entity.ts" - ], - "migrations": [ - "migrations/*.ts" - ], - "migrationsRun": true, - "synchronize": false, - "cli": { - "entitiesDir": "src", - "migrationsDir": "migrations" - } -}