Update main to 0.5.1. See changelog. #18

Merged
serversdown merged 16 commits from dev into main 2026-01-27 22:29:57 -05:00
6 changed files with 29 additions and 112 deletions
Showing only changes of commit d8a8330427 - Show all commits

17
docs/archive/README.md Normal file
View File

@@ -0,0 +1,17 @@
# Terra-View Documentation Archive
This directory contains old documentation files that are no longer actively maintained but preserved for historical reference.
## Archived Documents
### PROJECTS_SYSTEM_IMPLEMENTATION.md
Early implementation notes for the projects system. Superseded by current documentation in main docs directory.
### .aider.chat.history.md
AI assistant chat history from development sessions. Contains context and decision-making process.
## Note
These documents may contain outdated information. For current documentation, see:
- [Main README](../../README.md)
- [Active Documentation](../)

View File

@@ -1,120 +1,20 @@
# Helper Scripts # Terra-View Utility Scripts
This directory contains helper scripts for database management and testing. This directory contains utility scripts for database operations, testing, and maintenance.
## Database Migration Scripts ## Scripts
### migrate_dev_db.py ### create_test_db.py
Migrates the DEV database schema to add SLM-specific columns to the `roster` table. Generate a realistic test database with sample data.
**Usage:** Usage: python scripts/create_test_db.py
```bash
cd /home/serversdown/sfm/seismo-fleet-manager
python3 scripts/migrate_dev_db.py
```
**What it does:** ### rename_unit.py
- Adds 8 SLM-specific columns to the DEV database (data-dev/seismo_fleet.db) Rename a unit ID across all tables.
- Columns: slm_host, slm_tcp_port, slm_model, slm_serial_number, slm_frequency_weighting, slm_time_weighting, slm_measurement_range, slm_last_check
- Safe to run multiple times (skips existing columns)
### update_dev_db_schema.py Usage: python scripts/rename_unit.py <old_id> <new_id>
Inspects and displays the DEV database schema.
**Usage:** ### sync_slms_to_slmm.py
```bash Manually sync all SLM devices from Terra-View to SLMM.
python3 scripts/update_dev_db_schema.py
```
**What it does:** Usage: python scripts/sync_slms_to_slmm.py
- Shows all tables in the DEV database
- Lists all columns in the roster table
- Useful for verifying schema after migrations
## Test Data Scripts
### add_test_slms.py
Adds test Sound Level Meter units to the DEV database.
**Usage:**
```bash
python3 scripts/add_test_slms.py
```
**What it creates:**
- nl43-001: NL-43 SLM at Construction Site A
- nl43-002: NL-43 SLM at Construction Site B
- nl53-001: NL-53 SLM at Residential Area
- nl43-003: NL-43 SLM (not deployed, spare unit)
### add_test_modems.py
Adds test modem units to the DEV database and assigns them to SLMs.
**Usage:**
```bash
python3 scripts/add_test_modems.py
```
**What it creates:**
- modem-001, modem-002, modem-003: Deployed modems (Raven XTV and Sierra Wireless)
- modem-004: Spare modem (not deployed)
**Modem assignments:**
- nl43-001 → modem-001
- nl43-002 → modem-002
- nl53-001 → modem-003
## Cleanup Scripts
### remove_test_data_from_prod.py
**⚠️ PRODUCTION DATABASE CLEANUP**
Removes test data from the production database (data/seismo_fleet.db).
**Status:** Already executed successfully. Production database is clean.
**What it removed:**
- All test SLM units (nl43-001, nl43-002, nl53-001, nl43-003)
- All test modem units (modem-001, modem-002, modem-003, modem-004)
## Database Cloning
### clone_db_to_dev.py
Clones the production database to create/update the DEV database.
**Usage:**
```bash
python3 scripts/clone_db_to_dev.py
```
**What it does:**
- Copies data/seismo_fleet.db → data-dev/seismo_fleet.db
- Useful for syncing DEV database with production schema/data
## Setup Sequence
To set up a fresh DEV database with test data:
```bash
cd /home/serversdown/sfm/seismo-fleet-manager
# 1. Fix permissions (if needed)
sudo chown -R serversdown:serversdown data-dev/
# 2. Migrate schema
python3 scripts/migrate_dev_db.py
# 3. Add test data
python3 scripts/add_test_slms.py
python3 scripts/add_test_modems.py
# 4. Verify
sqlite3 data-dev/seismo_fleet.db "SELECT id, device_type FROM roster WHERE device_type IN ('sound_level_meter', 'modem');"
```
## Important Notes
- **DEV Database**: `data-dev/seismo_fleet.db` - Used for development and testing
- **Production Database**: `data/seismo_fleet.db` - Used by the running application
- All test scripts are configured to use the DEV database only
- Never run test data scripts against production