Phase 3.1: Enhanced Chore Logging and Reporting System

This commit is contained in:
2026-02-05 12:33:51 +11:00
commit e3cae7bfbb
178 changed files with 30105 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
# Database Fix - READY TO EXECUTE
## Problem Found
There were **TWO** `init_db.py` files:
1. `D:\Hosted\familyhub\backend\init_db.py`
2. `D:\Hosted\familyhub\backend\migrations\init_db.py`
Both were using UPPERCASE enum values (DAILY, PENDING, etc.) but the code expects lowercase values (daily, pending, etc.).
## What Was Fixed
### 1. ✅ app/models/chore.py
Added `values_callable=lambda x: [e.value for e in x]` to all SQLEnum columns to properly match enum values.
### 2. ✅ app/schemas/chore.py
Fixed `due_date` validators to convert empty strings to `None`.
### 3. ✅ backend/init_db.py
Changed ALL enum values from uppercase to lowercase.
### 4. ✅ backend/migrations/init_db.py
Changed ALL enum values from uppercase to lowercase.
## How To Fix
### Option 1: Use the Reset Script (Recommended)
1. Stop the backend server (Ctrl+C)
2. Run the reset script:
```
cd D:\Hosted\familyhub\backend
python reset_database.py
```
3. Restart the backend:
```
.\start_backend.bat
```
### Option 2: Manual Steps
1. Stop the backend server (Ctrl+C)
2. Delete the database:
```
del D:\Hosted\familyhub\backend\data\family_hub.db
```
3. Run initialization:
```
cd D:\Hosted\familyhub\backend
python init_db.py
```
4. Restart the backend:
```
.\start_backend.bat
```
## What You'll Get
After reinitialization:
- 5 demo users (jess, lou, william, xander, bella)
- Password for all: `password123`
- 12 demo chores with various frequencies and statuses
- All enum values properly set to lowercase
The chores will now load without errors! 🎉