mirror of
https://github.com/arthur-pbty/LazyBot.git
synced 2026-06-12 08:14:24 +02:00
refactor: migrate from SQLite to PostgreSQL for session management and data storage
- Updated package dependencies to replace SQLite with PostgreSQL. - Modified privacy policy to reflect the change in database technology. - Adjusted session management in server.js to use connect-pg-simple. - Enhanced docker-compose.yml to include PostgreSQL service with health checks. - Added Dockerfile for multi-stage builds for development and production environments. - Introduced .dockerignore to exclude unnecessary files from the Docker context.
This commit is contained in:
@@ -238,8 +238,9 @@ async function trackVoiceTime(guildId, userId, oldState, newState) {
|
||||
if (newState.channelId && !oldState.channelId) {
|
||||
// Save join timestamp
|
||||
db.run(
|
||||
`INSERT OR REPLACE INTO voice_sessions (guild_id, user_id, join_timestamp)
|
||||
VALUES (?, ?, ?)`,
|
||||
`INSERT INTO voice_sessions (guild_id, user_id, join_timestamp)
|
||||
VALUES (?, ?, ?)
|
||||
ON CONFLICT (guild_id, user_id) DO UPDATE SET join_timestamp = EXCLUDED.join_timestamp`,
|
||||
[guildId, userId, Date.now()]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user