| .. | ||
| 001_business_context_tables.sql | ||
| 002_fix_foreign_key_constraint.sql | ||
| migrate.py | ||
| README.md | ||
Requirement Processor Migrations
This directory contains database migrations for the requirement processor service.
Running Migrations
Option 1: Using Python Script
cd /home/tech4biz/Desktop/Projectsnew/CODENUK1/codenuk-backend-live/services/requirement-processor/migrations
python migrate.py
Option 2: Manual SQL Execution
# Connect to your database and run:
psql -d dev_pipeline -f 001_business_context_tables.sql
Option 3: Using Docker
# If using Docker Compose
docker-compose exec postgres psql -U postgres -d dev_pipeline -f /migrations/001_business_context_tables.sql
Migration Files
001_business_context_tables.sql- Creates business context tables with JSONB structurebusiness_context_responses- Stores user responses with questions arrayquestion_templates- Reusable question templates
Database Schema
business_context_responses
- id: UUID (Primary Key)
- user_id: UUID (Required)
- template_id: UUID (Optional)
- project_id: UUID (Foreign Key to projects)
- questions: JSONB Array of {question, answer} objects
- status: VARCHAR ('in_progress', 'completed', 'draft')
- created_at, updated_at: TIMESTAMP
question_templates
- id: UUID (Primary Key)
- template_name: VARCHAR
- questions: JSONB Array of question templates
- is_active: BOOLEAN
- created_at: TIMESTAMP
Environment Variables
Make sure these are set:
DATABASE_URL=postgresql://postgres:password@localhost:5432/dev_pipeline
Integration with Requirement Processor
The business context data will be available to your requirement processor service for enhanced analysis and better requirement understanding.