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