Update
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user