# IMMEDIATE PRODUCTION FIX - Missing related_loan_id Column

## Critical Issue
Production error persists: `OperationalError (1054, "Unknown column 'notifications.related_loan_id' in 'where clause'")`

## URGENT: Run This SQL Fix Immediately

### Option 1: Direct SQL (Fastest)
Log into your production database and run:

```sql
ALTER TABLE `utils_notification` ADD COLUMN `related_loan_id` char(32) NULL;
ALTER TABLE `utils_notification` ADD KEY `utils_notification_related_loan_id_idx` (`related_loan_id`);
```

### Option 2: Upload and Run Python Script
1. Upload `deploy_related_loan_id_fix.py` to your server
2. Run: `python deploy_related_loan_id_fix.py`

### Option 3: Database Management Tool
If using phpMyAdmin or similar:
1. Navigate to `utils_notification` table
2. Add new column:
   - Name: `related_loan_id`
   - Type: `CHAR(32)`
   - Null: `YES`
   - Default: `NULL`

## Verification
After applying the fix, run this SQL to verify:
```sql
DESCRIBE `utils_notification`;
```

You should see `related_loan_id` in the column list.

## Why This Happened
The production database migration didn't apply properly. The column exists in your local development but not in production.

## Post-Fix
- Client delete operations will work immediately
- No application restart required
- Error will disappear from all client operations
