Files
wvp-platform/数据库/aiot/迁移-添加edge_device_id字段.sql
16337 0eb2053c6f 功能:摄像头绑定边缘设备,截图请求按 device_id 隔离
- wvp_stream_proxy 新增 edge_device_id 字段
- StreamProxy 实体 + Mapper INSERT/UPDATE 支持
- 截图请求 XADD 时带上 device_id,边缘端按此过滤
- 存量数据默认绑定到 edge
2026-03-22 00:50:07 +08:00

12 lines
475 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 摄像头绑定边缘设备迁移脚本
-- 新增 edge_device_id 字段,标识摄像头属于哪个边缘端
-- Step 1: 添加 edge_device_id 列
ALTER TABLE wvp_stream_proxy ADD COLUMN edge_device_id VARCHAR(64) NULL AFTER area_id;
-- Step 2: 存量数据默认绑定到 edge第一台边缘设备
UPDATE wvp_stream_proxy SET edge_device_id = 'edge' WHERE edge_device_id IS NULL;
-- 验证
SELECT camera_code, camera_name, edge_device_id FROM wvp_stream_proxy;