codenuk_backend_mine/services/requirement-processor/migrations
2025-10-03 10:57:44 +05:30
..
001_business_context_tables.sql backend changes 2025-10-03 10:57:44 +05:30
002_fix_foreign_key_constraint.sql backend changes before techstack selector 2025-09-23 12:51:19 +05:30
migrate.py backend changes 2025-10-03 10:57:44 +05:30
README.md backend changes before techstack selector 2025-09-23 12:51:19 +05:30

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 structure
    • business_context_responses - Stores user responses with questions array
    • question_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.