Skip to content

Fix/batch processing schema mismatch#102

Merged
zephyranthes03 merged 2 commits intostagingfrom
fix/batch-processing-schema-mismatch
Jan 21, 2026
Merged

Fix/batch processing schema mismatch#102
zephyranthes03 merged 2 commits intostagingfrom
fix/batch-processing-schema-mismatch

Conversation

@zephyranthes03
Copy link
Contributor

No description provided.

The batch processing functions were using columns that don't exist
in the actual database schema. This fix aligns them with the existing
working functions.

DB Schema Analysis:
- watchers table: id, watcher_id, local_group_id, account_hash, group_id,
  title, folder, pattern, interval_seconds, is_recursive, created_at,
  updated_at, is_active, extra_json, is_deleted, deleted_at
- watcher_conditions table: separate table for conditions (not a column)
- watcher_groups table: no watcher_ids column

Fixes:
1. get_all_groups_with_watchers:
   - Remove non-existent columns: preset_id, conditions
   - Use correct JOIN column: w.group_id (not w.server_group_id)
   - Add missing columns: is_recursive, extra_json
   - Fetch conditions from watcher_conditions table separately

2. batch_upsert_watchers:
   - Use correct column names matching existing upsert_or_create_watcher
   - group_id = server's watcher_groups.id
   - local_group_id = client's group ID
   - Insert conditions into watcher_conditions table (not a column)

3. batch_soft_delete_groups:
   - Use correct column: group_id (not server_group_id) for watchers table
@zephyranthes03 zephyranthes03 merged commit c5d5c60 into staging Jan 21, 2026
6 checks passed
@zephyranthes03 zephyranthes03 deleted the fix/batch-processing-schema-mismatch branch January 21, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant