feat(ollama): implement case creation rewrite with strict rules fix(sync): include phone number in economic customer sync fix(migrations): clean up orphan links before enforcing foreign keys in email threading schema feat(migrations): add support for physical patch-panel layouts and update related constraints feat(migrations): add start port number for physical patch panels feat(migrations): introduce display order for physical panels feat(migrations): link wall outlets to switch hardware feat(migrations): allow optional label and customer for wall outlets feat(migrations): create hardware network links table feat(migrations): add location display order for hardware assets feat(migrations): create UISP devices and link to hardware assets
9 lines
393 B
SQL
9 lines
393 B
SQL
-- Link a wall outlet to the actual switch hardware, rather than only its display name.
|
|
ALTER TABLE locations_wall_outlets
|
|
ADD COLUMN IF NOT EXISTS switch_hardware_id INTEGER
|
|
REFERENCES hardware_assets(id) ON DELETE SET NULL;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_wall_outlets_switch_hardware_port
|
|
ON locations_wall_outlets(switch_hardware_id, switch_port)
|
|
WHERE deleted_at IS NULL;
|