Spaces:
Sleeping
Sleeping
| # 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. | |