Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Added mysql database synchronization rules depending on the application start stage

Yevhenii Kc6ada30f5e5a
diff --git a/src/app.module.ts b/src/app.module.ts
index 1a9c873bb..b1fdbd339 100644
--- a/src/app.module.ts
+++ b/src/app.module.ts
@@ -1,7 +1,7 @@
import { Module } from '@nestjs/common'
import { TypeOrmModule } from '@nestjs/typeorm'
import { ConfigModule } from '@nestjs/config'
-import { ScheduleModule } from '@nestjs/schedule'
+import { ScheduleModule } from '@nestjs/schedule'
import { AuthModule } from './auth/auth.module'
import { UserModule } from './user/user.module'
@@ -28,7 +28,7 @@ import { PingModule } from './ping/ping.module'
username: process.env.MYSQL_USER,
password: process.env.MYSQL_ROOT_PASSWORD,
database: process.env.MYSQL_DATABASE,
- synchronize: false,
+ synchronize: process.env.NODE_ENV === 'development' ? true : false,
entities: [User, ActionToken, Project, ProjectShare],
}),
ScheduleModule.forRoot(),