From 449b6bd9ac6d8f56bc53c9821008229d014074bc Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 14 Sep 2020 15:45:28 +0200 Subject: [PATCH] Fix database entity settings Signed-off-by: trivernis --- src/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index cf9bdff..01c7797 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import { createConnection } from 'typeorm'; import { UserServerAPI } from './datasources/userserver/userserviceAPI'; import express from 'express'; import { requiredPermissions } from './datasources/userserver/permission'; +import { CargoBike } from './model/CargoBike'; require('dotenv').config(); @@ -39,7 +40,12 @@ async function authenticate (req: any, res: any, next: any) { createConnection({ type: 'postgres', - url: process.env.POSTGRES_CONNECTION_URL + url: process.env.POSTGRES_CONNECTION_URL, + entities: [ + CargoBike + ], + synchronize: true, + logging: false }).then(async () => { console.log('connected to db'); }).catch(error => console.log(error));