This commit is contained in:
Eric Gullickson
2025-10-16 19:20:30 -05:00
parent 225520ad30
commit 5638d3960b
68 changed files with 4164 additions and 18995 deletions

View File

@@ -12,8 +12,10 @@ Complete database schema for MotoVaultPro Modified Feature Capsule architecture.
### Migration Tracking
- **Table**: `_migrations`
- **Purpose**: Created by `backend/src/_system/migrations/run-all.ts` (not yet used for skipping executed files)
- **Note**: Some SQL files use `IF NOT EXISTS`. Re-running all migrations may fail on indexes without `IF NOT EXISTS`.
- **Purpose**: Tracks executed migration files to prevent re-execution
- **Behavior**: Migration system is **idempotent at the file level** - will skip already executed files
- **SQL Statement Level**: Individual SQL statements within files may fail on re-run if they don't use `IF NOT EXISTS` clauses
- **Safety**: Safe to re-run the migration system; unsafe to manually re-run individual SQL files
## Core Tables
@@ -193,11 +195,16 @@ Single-feature migration is not implemented yet.
## Database Connection
### Development (Docker)
- **Host**: postgres (container name)
- **Port**: 5432
- **Host**: admin-postgres (container name)
- **Port**: 5432 (internal), 5432 (external)
- **Database**: motovaultpro
- **User**: postgres
- **Password**: localdev123
- **Password**: Loaded from secrets file `/run/secrets/postgres-password`
**Password Management**: All database passwords are managed via Docker secrets, mounted from host files:
- Application DB: `./secrets/app/postgres-password.txt`
- Platform DB: `./secrets/platform/platform-db-password.txt`
- Vehicles DB: `./secrets/platform/vehicles-db-password.txt`
### Connection Pool
- **Implementation**: pg (node-postgres)