Critical Bug Fix:
PostgreSQLDB.execute() expects data as dict, but workspace cleanup
was passing a list [workspace], causing cleanup to fail with
"PostgreSQLDB.execute() expects data as dict, got list" error.
Changes:
1. Fixed postgres_impl.py:2522
- Changed: await db.execute(delete_query, [workspace])
- To: await db.execute(delete_query, {"workspace": workspace})
2. Improved test_postgres_migration.py mock
- Enhanced COUNT(*) mock to properly distinguish between:
* Legacy table with workspace filter (returns 50)
* Legacy table without filter after deletion (returns 0)
* New table verification (returns 50)
- Uses storage.legacy_table_name dynamically instead of hardcoded strings
- Detects table type by checking for model suffix patterns
3. Fixed test_unified_lock_safety.py formatting
- Applied ruff formatting to assert statement
Impact:
- Workspace-aware legacy cleanup now works correctly
- Legacy tables properly deleted when all workspace data migrated
- Legacy tables preserved when other workspace data remains
Tests: All 25 unit tests pass