Files
terra-view/scripts
serversdown 7516bbea70 feat: add manual SD card data upload for offline NRLs; rename RecordingSession to MonitoringSession
- Add POST /api/projects/{project_id}/nrl/{location_id}/upload-data endpoint
  accepting a ZIP or multi-file select of .rnd/.rnh files from an SD card.
  Parses .rnh metadata for session start/stop times, serial number, and store
  name. Creates a MonitoringSession (no unit assignment required) and DataFile
  records for each measurement file.

- Add Upload Data button and collapsible upload panel to the NRL detail Data
  Files tab, with inline success/error feedback and automatic file list refresh
  via HTMX after import.

- Rename RecordingSession -> MonitoringSession throughout the codebase
  (models.py, projects.py, project_locations.py, scheduler.py, roster_rename.py,
  main.py, init_projects_db.py, scripts/rename_unit.py). DB table renamed from
  recording_sessions to monitoring_sessions; old indexes dropped and recreated.

- Update all template UI copy from Recording Sessions to Monitoring Sessions
  (nrl_detail, projects/detail, session_list, schedule_oneoff, roster).

- Add backend/migrate_rename_recording_to_monitoring_sessions.py for applying
  the table rename on production databases before deploying this build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 19:54:40 +00:00
..
2025-12-16 20:02:04 +00:00
2026-01-16 19:07:08 +00:00

Terra-View Utility Scripts

This directory contains utility scripts for database operations, testing, and maintenance.

Scripts

create_test_db.py

Generate a realistic test database with sample data.

Usage: python scripts/create_test_db.py

rename_unit.py

Rename a unit ID across all tables.

Usage: python scripts/rename_unit.py <old_id> <new_id>

sync_slms_to_slmm.py

Manually sync all SLM devices from Terra-View to SLMM.

Usage: python scripts/sync_slms_to_slmm.py