Files
fn_registry/registry/migrations/011_pc_locations.sql
T
egutierrez 046d21e721 feat: registry_api + fn sync — sincronización de registry.db entre PCs
Nuevo sistema para mantener datos no regenerables (proposals, apps, projects,
analysis, vaults, pc_locations) sincronizados entre múltiples máquinas via
una API HTTP central desplegada en organic-machine.com.

- Migración 011: tabla pc_locations (mapa de ubicaciones por PC)
- registry/models.go: struct PcLocation
- registry/store.go: CRUD PcLocation + helpers de sync
- cmd/fn/sync.go: subcomando fn sync (push+pull, status, locations)
- bash/functions/infra/setup_registry_api: pipeline de deploy Docker+Traefik
- CLAUDE.md: documentación de sync y pc_locations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 02:12:38 +02:00

19 lines
796 B
SQL

-- pc_locations: mapa de ubicaciones por máquina.
-- Cada PC registra dónde tiene cada app, analysis, project o vault.
CREATE TABLE IF NOT EXISTS pc_locations (
id TEXT PRIMARY KEY,
entity_type TEXT NOT NULL CHECK(entity_type IN ('app', 'analysis', 'project', 'vault')),
entity_id TEXT NOT NULL,
pc_id TEXT NOT NULL,
dir_path TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'active' CHECK(status IN ('active', 'missing', 'archived')),
notes TEXT NOT NULL DEFAULT '',
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
UNIQUE(entity_type, entity_id, pc_id)
);
CREATE INDEX IF NOT EXISTS idx_pc_locations_pc ON pc_locations(pc_id);
CREATE INDEX IF NOT EXISTS idx_pc_locations_entity ON pc_locations(entity_type, entity_id);