bmc_hub/migrations/206_normalize_bmc_networks_heads.sql
Christian 3311b8e590 Add comprehensive tests for internet connections module, invoice parsing, and subscription provisioning
- Implement tests for the internet connections module, covering routes, IP range creation, and connection validation.
- Add tests for the Invoice2DataService to validate extraction from GlobalConnect invoices.
- Create tests for subscription network provisioning, ensuring proper handling of network items and IP allocations.
- Include validation checks for subtotal mismatches and ensure error handling for missing IP selections.
2026-07-09 23:44:30 +02:00

16 lines
465 B
SQL

WITH bmc_owner AS (
SELECT MIN(id) AS id
FROM customers
WHERE lower(name) = 'bmc networks'
AND is_active = true
)
UPDATE internet_connections_connections ic
SET customer_id = COALESCE((SELECT id FROM bmc_owner), ic.customer_id),
allocation_model = 'shared',
value_type = 'bmc_networks',
value_label = NULL,
updated_at = CURRENT_TIMESTAMP
WHERE ic.deleted_at IS NULL
AND ic.parent_id IS NULL
AND ic.value_type = 'bmc_networks';