From 2499cc526fff322016c963fa59251284b0447807 Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Tue, 15 Sep 2020 15:40:52 +0200 Subject: [PATCH] src/index.ts: added entities to postgres connection --- src/index.ts | 22 +++++++++++++++++++++- src/model/Organization.ts | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 01c7797..1989ba2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,16 @@ import { UserServerAPI } from './datasources/userserver/userserviceAPI'; import express from 'express'; import { requiredPermissions } from './datasources/userserver/permission'; import { CargoBike } from './model/CargoBike'; +import { BikeEvent } from './model/BikeEvent'; +import { BikeModel } from './model/BikeModel'; +import { ChainSwap } from './model/ChainSwap'; +import { ContactInformation } from './model/ContactInformation'; +import { Equipment } from './model/Equipment'; +import { LendingStation } from './model/LendingStation'; +import { LoanPeriod } from './model/LoanPeriod'; +import { Participant } from './model/Participant'; +import { Organization } from './model/Organization'; +import { Provider } from './model/Provider'; require('dotenv').config(); @@ -42,7 +52,17 @@ createConnection({ type: 'postgres', url: process.env.POSTGRES_CONNECTION_URL, entities: [ - CargoBike + CargoBike, + BikeEvent, + BikeModel, + ChainSwap, + ContactInformation, + Equipment, + LendingStation, + LoanPeriod, + Organization, + Participant, + Provider ], synchronize: true, logging: false diff --git a/src/model/Organization.ts b/src/model/Organization.ts index 11dac04..4ca086f 100644 --- a/src/model/Organization.ts +++ b/src/model/Organization.ts @@ -1,7 +1,8 @@ -import { PrimaryGeneratedColumn, OneToOne, OneToMany, Column } from 'typeorm'; +import { PrimaryGeneratedColumn, OneToOne, OneToMany, Column, Entity } from 'typeorm'; import { LendingStation } from './LendingStation'; import { Provider } from './Provider'; +@Entity() export class Organization { @PrimaryGeneratedColumn() id: number;