From cbf1285d5ddc11f38b9ee646e02ae003e3edeb35 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Mon, 3 Sep 2018 03:58:26 -0600 Subject: [PATCH] fix: don't always synchronize, use TYPEORM_SYNCHRONIZE env --- docker-compose.dev.yml | 1 + docker-compose.yml | 1 + server/Database.ts | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 62ccb6c..2cab8ba 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -24,6 +24,7 @@ services: - TYPEORM_DATABASE=postgres - TYPEORM_USERNAME=postgres - TYPEORM_PASSWORD=8JN4w0UsN5dbjMjNvPe452P2yYOqg5PV + - TYPEORM_SYNCHRONIZE=true - MQTT_URL=tcp://mosquitto:1883 # Must specify JWT_SECRET and MQTT_URL diff --git a/docker-compose.yml b/docker-compose.yml index 89273b9..d8af50e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,7 @@ services: - TYPEORM_DATABASE=postgres - TYPEORM_USERNAME=postgres - TYPEORM_PASSWORD=8JN4w0UsN5dbjMjNvPe452P2yYOqg5PV + - TYPEORM_SYNCHRONIZE=true # Must specify JWT_SECRET and MQTT_URL database: diff --git a/server/Database.ts b/server/Database.ts index 0f6fef2..3e5e9cb 100644 --- a/server/Database.ts +++ b/server/Database.ts @@ -38,7 +38,6 @@ export class Database { } async createAll() { - await this.conn.synchronize(); if (process.env.INSERT_TEST_DATA) { await this.insertData(); }