wvp-GB28181-pro/数据库/结构优化/common.sql

175 lines
5.2 KiB
MySQL
Raw Normal View History

2024-01-25 18:18:42 +08:00
CREATE TABLE wvp_common_channel
2023-08-21 17:54:15 +08:00
(
2024-01-25 18:18:42 +08:00
common_gb_id serial primary key,
common_gb_device_id varchar(50) NOT NULL,
common_gb_name varchar(255) DEFAULT NULL,
common_gb_manufacturer varchar(255) DEFAULT NULL,
common_gb_model varchar(255) DEFAULT NULL,
common_gb_owner varchar(255) DEFAULT NULL,
common_gb_civilCode varchar(50) DEFAULT NULL,
common_gb_block varchar(255) DEFAULT NULL,
common_gb_address varchar(255) DEFAULT NULL,
common_gb_parental integer,
common_gb_parent_id varchar(50) DEFAULT NULL,
common_gb_safety_way integer,
common_gb_register_way integer,
common_gb_cert_num varchar(255) DEFAULT NULL,
common_gb_certifiable integer,
common_gb_err_code integer,
common_gb_end_time varchar(50) DEFAULT NULL,
common_gb_secrecy integer,
common_gb_ip_address varchar(50) DEFAULT NULL,
common_gb_port integer,
common_gb_password varchar(50) DEFAULT NULL,
common_gb_status bool default false,
common_gb_longitude double,
common_gb_latitude double,
common_gb_ptz_type integer,
common_gb_position_type integer,
common_gb_room_type integer,
common_gb_use_type integer,
common_gb_supply_light_type integer,
common_gb_direction_type integer,
common_gb_resolution varchar(255) DEFAULT NULL,
common_gb_business_group_id varchar(255) DEFAULT NULL,
common_gb_download_speed varchar(255) DEFAULT NULL,
common_gb_svc_time_support_mode integer,
common_gb_svc_space_support_mode integer,
type varchar(255) NOT NULL,
update_time varchar(50) NOT NULL,
create_time varchar(50) NOT NULL,
UNIQUE KEY common_gb_device_id (common_gb_device_id)
);
CREATE TABLE wvp_common_group
2023-08-21 17:54:15 +08:00
(
2024-01-25 18:18:42 +08:00
common_group_id serial primary key,
common_group_device_id varchar(50) NOT NULL,
common_group_name varchar(255) NOT NULL,
common_group_parent_id varchar(50) DEFAULT NULL,
common_group_top_id varchar(50) DEFAULT NULL,
common_group_create_time varchar(50) NOT NULL,
common_group_update_time varchar(50) NOT NULL,
UNIQUE KEY common_group_device_id (common_group_device_id)
);
CREATE TABLE wvp_common_region
2023-08-21 17:54:15 +08:00
(
2024-01-25 18:18:42 +08:00
common_region_id serial primary key,
common_region_device_id varchar(50) NOT NULL,
common_region_name varchar(255) NOT NULL,
common_region_parent_id varchar(50) DEFAULT NULL,
common_region_create_time varchar(50) NOT NULL,
common_region_update_time varchar(50) NOT NULL,
UNIQUE KEY common_region_device_id (common_region_device_id)
);
CREATE TABLE wvp_common_channel_platform
2023-08-21 17:54:15 +08:00
(
2024-01-25 18:18:42 +08:00
id serial primary key,
platform_id integer,
common_gb_channel_id integer,
UNIQUE KEY uk_platform_id_common_gb_channel_id (platform_id,common_gb_channel_id)
);
2023-08-21 17:54:15 +08:00
2023-12-04 21:56:21 +08:00
drop table wvp_platform_gb_stream;
drop table wvp_platform_gb_channel;
drop table wvp_platform_catalog;
drop table wvp_platform_gb_channel;
drop table wvp_resources_tree;
2023-08-21 17:54:15 +08:00
alter table wvp_platform
add share_all_channel bool default false;
alter table wvp_platform
add share_group bool default true;
alter table wvp_platform
add share_region bool default false;
2023-12-07 18:04:53 +08:00
alter table wvp_device_channel
add common_gb_channel_id integer;
2023-12-08 18:05:14 +08:00
alter table wvp_stream_push
add name varchar(255) default NULL;
2023-12-07 18:04:53 +08:00
alter table wvp_stream_push
add common_gb_channel_id integer;
alter table wvp_stream_proxy
add common_gb_channel_id integer;
2023-12-08 18:05:14 +08:00
alter table wvp_stream_push
drop column origin_type;
alter table wvp_stream_push
drop column origin_type_str;
alter table wvp_stream_push
add gb_id varchar(50) default NULL;
alter table wvp_stream_push
add longitude double precision;
alter table wvp_stream_push
add latitude double precision;
alter table wvp_stream_push
add status bool default false;
2023-12-18 23:44:37 +08:00
alter table wvp_stream_proxy
add gb_id varchar(50) default NULL;
alter table wvp_stream_proxy
add longitude double precision;
alter table wvp_stream_proxy
add latitude double precision;
alter table wvp_stream_proxy
2024-01-19 14:33:34 +08:00
add pulling bool default false;
alter table wvp_stream_proxy
add pulling bool default false;
alter table wvp_stream_proxy
add pull_time varchar(255) default NULL;
2023-12-18 23:44:37 +08:00
alter table wvp_stream_proxy
add proxy_error varchar(255) default NULL;
2024-01-19 14:33:34 +08:00
alter table wvp_stream_proxy
drop column enable;
2023-12-19 18:49:49 +08:00
alter table wvp_device
drop column auto_sync_channel;
2024-01-05 16:58:31 +08:00
alter table wvp_stream_push
drop column total_reader_count;
alter table wvp_stream_push
drop column alive_second;
2024-01-13 00:40:41 +08:00
alter table wvp_stream_proxy
drop column src_url;
2024-01-23 16:20:36 +08:00
alter table wvp_platform
drop column administrative_division;
alter table wvp_platform
drop column catalog_id;
2024-01-30 00:00:49 +08:00
alter table wvp_platform
add column system_catalog bool default false;
2023-12-18 23:44:37 +08:00
2023-12-08 18:05:14 +08:00
2023-08-21 17:54:15 +08:00