-- Migration: 074_remove_service_center_type
-- Created: 2026-01-31
-- Description: Remove service_center type from locations

BEGIN;

-- Normalize existing records
UPDATE locations_locations
SET location_type = 'branch'
WHERE location_type = 'service_center';

ALTER TABLE locations_locations
    DROP CONSTRAINT IF EXISTS locations_locations_location_type_check;

ALTER TABLE locations_locations
    ADD CONSTRAINT locations_locations_location_type_check
    CHECK (location_type IN (
        'bygning',
        'etage',
        'rum',
        'vehicle',
        'branch',
        'warehouse',
        'client_site',
        'customer_site'
    ));

COMMIT;
