| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- -- soc v0.1.1 版本升级脚本
- DELIMITER ??
- DROP PROCEDURE IF EXISTS schema_change ??
- CREATE PROCEDURE schema_change()
- BEGIN
- END ??
- DELIMITER ;
- CALL schema_change();
- -- 新增ups设备表
- drop table if exists iot_ups;
- create table if not exists iot_ups
- (
- id bigint not null
- primary key,
- org_id bigint null comment '机构id',
- org_name varchar(255) null comment '机构名称',
- org_path varchar(255) null comment '机构path',
- host_code varchar(64) null comment '视频物联网检测主机唯一标识',
- device_name varchar(100) null comment '设备名称',
- device_type varchar(32) null comment '设备类型',
- device_code varchar(64) null comment '设备code',
- ups_unique_code varchar(225) null comment 'ups唯一标识,机构code+主机code+deviceCode组成设备唯一',
- info varchar(2000) null comment '属性信息数组',
- deleted int default 0 null comment '0正常1删除',
- state_update_time datetime null comment '最后一次状态更新时间',
- update_time datetime null comment '更新时间,最后一次数据上传时间',
- create_time datetime null comment '创建时间',
- create_by varchar(255) null comment '创建人',
- update_by varchar(32) null comment '修改人',
- source int default 1 null comment '设备来源:0:平台主动新增,1:iot推送',
- status int default 2 null comment '设备告警状态: 0:正常,1:异常,2:未知',
- mains_electricity_status int default 2 null comment 'ups市电状态,0:正常1:异常2:未知',
- low_pressure_status int default 2 null comment 'ups电池电压低告警,0:正常1:异常2:未知',
- constraint idx_unique_ups_code unique (ups_unique_code)
- )
- comment 'ups表信息' row_format = DYNAMIC;
- -- 新增ups设备日志表
- drop table if exists iot_ups_data_log;
- create table if not exists iot_ups_data_log
- (
- id bigint not null
- primary key,
- org_id bigint null comment '机构id',
- org_name varchar(255) null comment '机构名称',
- org_path varchar(255) null comment '机构path',
- host_code varchar(64) null comment '视频物联网检测主机唯一标识',
- device_name varchar(100) null comment '设备名称',
- device_type varchar(32) null comment '设备类型',
- device_code varchar(64) null comment '设备code',
- ups_unique_code varchar(225) null comment 'ups唯一标识,机构code+主机code+deviceCode组成设备唯一',
- info varchar(2000) null comment '属性信息数组',
- deleted int default 0 null comment '0正常1删除',
- state_update_time datetime null comment '最后一次状态更新时间',
- update_time datetime null comment '更新时间,最后一次数据上传时间',
- create_time datetime null comment '创建时间',
- create_by varchar(255) null comment '创建人',
- update_by varchar(32) null comment '修改人',
- source int default 1 null comment '设备来源:0:平台主动新增,1:iot推送',
- status int default 2 null comment '设备告警状态: 0:正常,1:异常,2:未知',
- mains_electricity_status int default 2 null comment 'ups市电状态,0:正常1:异常2:未知',
- low_pressure_status int default 2 null comment 'ups电池电压低告警,0:正常1:异常2:未知',
- ups_id bigint null comment 'ups表id',
- constraint idx_unique_ups_code unique (ups_unique_code)
- )
- comment 'ups表信息' row_format = DYNAMIC;
- -- 新增ups设备属性表
- drop table if exists iot_ups_attr;
- create table if not exists iot_ups_attr
- (
- id int auto_increment
- primary key,
- rule_key varchar(50) null,
- rule_value int null,
- unit varchar(50) null,
- start int default 0 null
- )
- comment 'ups设备属性' row_format = DYNAMIC;
|