- Move completed migration docs to docs/archive/ - Move session summaries to docs/archive/sessions/ - Rename API_ASP_DOCUMENTATION.md to docs/API.md - Archive redundant Claude reference files - Update docs/README.md as simplified index - Reduce active docs from 45+ files to 8 essential files Remaining docs: - CLAUDE.md (AI context) - TODO.md (task tracking) - docs/README.md, API.md, QUICK_REFERENCE.md - docs/ASP_DEVELOPMENT_GUIDE.md, STANDARDS.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4.6 KiB
4.6 KiB
Database Migration - Status Summary
Last Updated: 2025-11-25 Current Phase: Phase 2 COMPLETE, Phase 3 PLANNED
Migration Status
| Phase | Status | Description | Completed |
|---|---|---|---|
| Phase 1 | COMPLETE | Schema changes (tables, columns, indexes) | Nov 6, 2025 |
| Phase 2 | COMPLETE | PC migration to machines table | Nov 10, 2025 |
| Phase 3 | COMPLETE | Network devices - legacy tables dropped | Nov 25, 2025 |
Phase 1: Schema Changes (COMPLETE)
Completed: November 6, 2025
New Tables Created (7)
comstypes- Communication types (IP, Serial, etc.)communications- Unified network interfaceswarranties- Warranty trackingcompliance- Compliance trackingcompliancescans- Scan historyrelationshiptypes- Relationship type definitionsmachinerelationships- Machine-to-machine relationships
Tables Modified (2)
machines- Added 11 columns (hostname, serialnumber, osid, pctypeid, etc.)businessunits- Added liaison fields
Tables Renamed
pcstatus→machinestatus
Phase 2: PC Migration (COMPLETE)
Completed: November 10, 2025
Data Migrated
- 277 PCs migrated from
pctable →machinestable - 705+ network interfaces →
communicationstable - Dualpath relationships →
machinerelationshipstable - PC→Equipment relationships →
machinerelationshipstable
Schema Changes
- PCs identified by
pctypeid IS NOT NULLin machines table - Network interfaces use
communications.addressfield - Relationships use
machinerelationshipstable
Pages Updated
- displaypcs.asp, displaypc.asp, editpc.asp
- displaymachines.asp, displaymachine.asp
- network_map.asp, network_devices.asp
- All save/update device pages
API Fixes
- Fixed 36+ IIf() bugs in api.asp
- Fixed PC→Machine relationship creation
- PowerShell data collection fully working
Phase 3: Network Devices (COMPLETE)
Completed: November 25, 2025
What Happened
- Legacy tables were essentially empty (only 3 servers had data)
- Network devices were already being added directly to
machinestable - Dropped all legacy network device tables
Tables Dropped
servers(3 records - not migrated, stale data)switches(empty)cameras(empty)accesspoints(empty)idfs(empty)
Current Network Device Types in machines Table
| machinetypeid | Type |
|---|---|
| 16 | Access Point |
| 17 | IDF |
| 18 | Camera |
| 19 | Switch |
| 20 | Server |
Printers
- Stay in separate
printerstable (by design - unique fields, workflows)
Current Architecture
machines table (unified)
├── Equipment (machinetypeid 1-24, pctypeid IS NULL)
├── PCs (machinetypeid 25-29, pctypeid IS NOT NULL)
└── [Future] Network Devices (machinetypeid 30-36)
printers table (separate)
communications table (all network interfaces)
machinerelationships table (all relationships)
Key Queries
-- All PCs
SELECT * FROM machines WHERE pctypeid IS NOT NULL;
-- All Equipment (non-PC)
SELECT * FROM machines WHERE pctypeid IS NULL;
-- PCs with network info
SELECT m.hostname, m.serialnumber, c.address
FROM machines m
LEFT JOIN communications c ON m.machineid = c.machineid
WHERE m.pctypeid IS NOT NULL;
-- PC → Equipment relationships
SELECT
pc.hostname AS pc_name,
eq.machinenumber AS equipment_name
FROM machinerelationships mr
JOIN machines pc ON mr.machineid = pc.machineid
JOIN machines eq ON mr.related_machineid = eq.machineid
JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid
WHERE rt.relationshiptype = 'Controls';
Deprecated Tables (Phase 2)
These tables are deprecated but kept for rollback safety:
pc→ Usemachines WHERE pctypeid IS NOT NULLpc_network_interfaces→ Usecommunicationspc_comm_config→ Usecommunicationspc_dualpath_assignments→ Usemachinerelationshipspcstatus→ Usemachinestatus
Recommendation: Drop after 30 days of stable operation
Related Documentation
- DATABASE_MIGRATION_FINAL_DESIGN.md - Phase 1 spec
- PC_MACHINES_CONSOLIDATION_PLAN.md - Phase 2 plan
- PHASE3_NETWORK_DEVICES_MIGRATION_PLAN.md - Phase 3 plan
- MIGRATION_QUICK_REFERENCE.md - Quick lookup
Last Updated: 2025-11-25