When the network is down, sync_file() logs individual errors for each
file. Now run_once() detects when all files fail and emits a single
summary warning instead of proceeding with redundant "no changes" logs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Set cursor.fast_executemany = True (pyodbc 5.x moved it to cursor)
- merge_sources() now returns source row counts, avoiding re-reading files
- Single commit at end of batch_insert instead of per-batch commits
- Pre-build all rows before SQL execution
- Result: PG_2022 migration improved from ~5min to ~36s (7.6x faster)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add logger.py with TimedRotatingFileHandler (daily rotation, 30-day retention)
- Replace all print() in migrate.py with logging calls
- Add logging to sync.py for sync status tracking
- Refactor watch.py to use logger.py, remove duplicate first_run branch
- All logs now go to logs/app.log consistently
- Add logging config section to config.yaml, add logs/ to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add sync.py for LAN file sync with atomic writes and mtime-based change detection
- Add watch.py daemon that periodically syncs files and migrates only changed tables
- Add TRUNCATE mode to migrate.py (--truncate flag) to preserve table structure
- Update config.yaml schema with check_interval_minutes and lan_sources
- Update README with new features documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrates pressure gauge (PG) and thermometer (TM) data from .xlsm files
into SQL Server executionCard schema, one table per year (PG_2022-2026,
TM_2022-2026). Supports single/multi-table migration, column remapping,
type inference, and dry-run mode via config.yaml.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>