Source: data_layer/docs/REORGANIZATION_COMPLETE.md
Database Reorganization - COMPLETE ✅
Date: 2025-01-14 Status: Implementation complete
What Changed
1. JSON Schemas Moved to json/ Subdirectory
- Before:
schemas/domain/v1/*.json - After:
schemas/domain/v1/json/*.json
2. Neo4j Schemas Grouped with Domain
- Before:
sql/neo4j_*.cypher(confusing!) - After:
schemas/domain/v1/neo4j/*.cypher(logical!)
3. PostgreSQL Moved to Infrastructure
- Before:
sql/*.sql - After:
schemas/infrastructure/postgresql/*.sql
New Structure
database/schemas/
├── domain/v1/
│ ├── json/*.schema.json ← JSON Schema (validation)
│ └── neo4j/*.cypher ← Neo4j Cypher (graph)
│
├── infrastructure/
│ ├── postgresql/*.sql ← PostgreSQL DDL
│ └── prisma/ ← Prisma ORM (future)
│
└── generated/ ← Auto-generatedScripts Updated
✅ scripts/validate_schema_sync.py - Now uses new paths
What Still Works
✅ Schema generation: ./scripts/regenerate_adapters.sh
✅ Validation: python database/scripts/validate_schema_sync.py
✅ Backward compat: Old sql/ files still exist
Benefits
✅ Neo4j grouped with JSON (both domain models)
✅ Clear separation: domain vs infrastructure
✅ Easier to find specific schemas
✅ Better organization for future v2
See REORGANIZATION_PROPOSAL.md and REORGANIZATION_VISUAL.md for details.