psql
This commit is contained in:
26
.serena/memories/postgresql_migration_complete.md
Normal file
26
.serena/memories/postgresql_migration_complete.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# PostgreSQL Migration Completed
|
||||
|
||||
## Changes Made
|
||||
- **Docker Compose**: Added PostgreSQL 15 service with persistent data volume
|
||||
- **Database Configuration**: Migrated from SQLite3 to PostgreSQL using pg library
|
||||
- **Package Dependencies**: Updated package.json (removed sqlite3, added pg and @types/pg)
|
||||
- **Database Class**: Converted all methods to use PostgreSQL syntax and async/await pattern
|
||||
|
||||
## Key Configuration
|
||||
- Database URL: `postgresql://quixotic:quixotic123@postgres:5432/quixotic`
|
||||
- Container: `quixotic-postgres` with health checks
|
||||
- Volume: `postgres-data` for data persistence
|
||||
- Environment variables: POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD
|
||||
|
||||
## Database Schema Changes
|
||||
- INTEGER PRIMARY KEY → SERIAL PRIMARY KEY
|
||||
- BIGINT for telegram_id (better for large Telegram IDs)
|
||||
- TIMESTAMP instead of DATETIME
|
||||
- PostgreSQL-style REFERENCES syntax for foreign keys
|
||||
- ON CONFLICT DO UPDATE for upsert operations
|
||||
|
||||
## Status
|
||||
✅ Migration completed successfully
|
||||
✅ Application starts without database errors
|
||||
✅ All dependencies installed
|
||||
✅ Docker containers running properly
|
||||
Reference in New Issue
Block a user