mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 12:49:41 +03:00
Some db fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
DATABASE_PASSWORD=postgres
|
||||
DATABASE_NAME=bot_db
|
||||
DATABASE_USER=postgres
|
||||
DATABASE_USERNAME=postgres
|
||||
DATABASE_HOST=localhost
|
||||
DATABASE_PORT=5432
|
||||
|
||||
|
||||
@@ -39,8 +39,10 @@ export class SettingsService {
|
||||
editProfile.isActive = data.isActive;
|
||||
if (data.isActive) {
|
||||
const nowActive = await this.botSettingsRepository.findOneBy({ isActive: true });
|
||||
nowActive.isActive = false;
|
||||
await this.botSettingsRepository.save(nowActive);
|
||||
if (nowActive) {
|
||||
nowActive.isActive = false;
|
||||
await this.botSettingsRepository.save(nowActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
return await this.botSettingsRepository.save(editProfile);
|
||||
|
||||
@@ -5,7 +5,7 @@ services:
|
||||
container_name: neuro_db
|
||||
image: postgres:alpine
|
||||
environment:
|
||||
- POSTGRES_USER=${DATABASE_USER}
|
||||
- POSTGRES_USER=${DATABASE_USERNAME}
|
||||
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
|
||||
- POSTGRES_DB=${DATABASE_NAME}
|
||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||
|
||||
Reference in New Issue
Block a user