{"-- Add security zone and description to cameras table
ALTER TABLE public.cameras 
ADD COLUMN security_zone_id uuid REFERENCES public.security_zones(id),
ADD COLUMN description text,
ADD COLUMN detection_rules jsonb DEFAULT '[]'::jsonb","-- Update cameras table with updated_at trigger
CREATE TRIGGER update_cameras_updated_at
    BEFORE UPDATE ON public.cameras
    FOR EACH ROW
    EXECUTE FUNCTION public.update_modified_column()","-- Add some default detection rule types
INSERT INTO public.detection_rules (name, description, object_types, min_confidence, organization_id) VALUES
('Fire Detection', 'Detect fire and smoke incidents', ARRAY['fire', 'smoke'], 0.8, null),
('Person Counting', 'Count number of people in area', ARRAY['person'], 0.7, null),
('Cleanliness Monitoring', 'Monitor cleanliness and hygiene standards', ARRAY['garbage', 'spill', 'mess'], 0.6, null),
('Vehicle Detection', 'Detect vehicles in restricted areas', ARRAY['car', 'truck', 'motorcycle'], 0.7, null),
('Intrusion Detection', 'Detect unauthorized access', ARRAY['person'], 0.8, null)
ON CONFLICT DO NOTHING"}