RAJAWAT's picture
deploy: clean backend code and config deployment to Hugging Face
25259b5
|
Raw
History Blame Contribute Delete
1.22 kB
# Database Module
This module contains the schemas, configuration models, and migration scripts for the Cognitive Voice Intelligence Platform relational database.
---
## πŸ“ Folder Structure
```
database/
β”œβ”€β”€ README.md # This documentation
β”œβ”€β”€ schema.sql # Raw SQL definitions of tables and indices
β”œβ”€β”€ alembic.ini # Alembic migration settings (future tool configuration)
└── models/ # SQLAlchemy models
β”œβ”€β”€ __init__.py # Package exports
β”œβ”€β”€ session.py # Session and workflow tables
β”œβ”€β”€ audio.py # Audio metadata file tracking
β”œβ”€β”€ analytics.py # Temporal & Linguistic analytics
└── risk.py # Calculated Cognitive Risk scores
```
---
## πŸ› οΈ Schema Initialization
For local testing, you can execute the raw `schema.sql` directly:
```bash
psql -U postgres -d cognitive_voice_db -f database/schema.sql
```
For SQLAlchemy ORM applications, tables can be initialized programmatically using the developer helper script:
```bash
python scripts/db_init.py
```
For production environments, database updates must be managed using Alembic.