Fix database entity settings

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/6/head
trivernis 4 years ago
parent e1312d93bc
commit 449b6bd9ac
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -7,6 +7,7 @@ import { createConnection } from 'typeorm';
import { UserServerAPI } from './datasources/userserver/userserviceAPI'; import { UserServerAPI } from './datasources/userserver/userserviceAPI';
import express from 'express'; import express from 'express';
import { requiredPermissions } from './datasources/userserver/permission'; import { requiredPermissions } from './datasources/userserver/permission';
import { CargoBike } from './model/CargoBike';
require('dotenv').config(); require('dotenv').config();
@ -39,7 +40,12 @@ async function authenticate (req: any, res: any, next: any) {
createConnection({ createConnection({
type: 'postgres', type: 'postgres',
url: process.env.POSTGRES_CONNECTION_URL url: process.env.POSTGRES_CONNECTION_URL,
entities: [
CargoBike
],
synchronize: true,
logging: false
}).then(async () => { }).then(async () => {
console.log('connected to db'); console.log('connected to db');
}).catch(error => console.log(error)); }).catch(error => console.log(error));

Loading…
Cancel
Save