2024-12-12 14:37:08 +08:00
|
|
|
create table iot_device
|
|
|
|
(
|
2025-01-09 17:28:33 +08:00
|
|
|
id bigserial
|
2024-12-12 14:37:08 +08:00
|
|
|
constraint 表_name_pk
|
|
|
|
primary key,
|
|
|
|
name varchar,
|
|
|
|
online boolean,
|
|
|
|
state integer,
|
|
|
|
hardware_version varchar,
|
|
|
|
firmware_version varchar,
|
|
|
|
factory_id varchar,
|
|
|
|
client_id varchar,
|
|
|
|
product_id bigint,
|
2025-01-09 17:28:33 +08:00
|
|
|
extend_params jsonb,
|
|
|
|
properties jsonb,
|
2024-12-12 14:37:08 +08:00
|
|
|
create_by varchar,
|
|
|
|
create_time timestamp,
|
|
|
|
update_by varchar,
|
|
|
|
update_time timestamp,
|
2025-01-09 17:28:33 +08:00
|
|
|
remark varchar,
|
|
|
|
dept_id bigint
|
2024-12-12 14:37:08 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
comment on column iot_device.id is '主键';
|
|
|
|
|
|
|
|
comment on constraint 表_name_pk on iot_device is '主键';
|
|
|
|
|
|
|
|
comment on column iot_device.name is '设备名称';
|
|
|
|
|
|
|
|
comment on column iot_device.online is '是否在线';
|
|
|
|
|
|
|
|
comment on column iot_device.state is '设备状态';
|
|
|
|
|
|
|
|
comment on column iot_device.hardware_version is '硬件版本';
|
|
|
|
|
|
|
|
comment on column iot_device.firmware_version is '固件版本';
|
|
|
|
|
|
|
|
comment on column iot_device.factory_id is '出厂ID';
|
|
|
|
|
|
|
|
comment on column iot_device.client_id is '客户ID';
|
|
|
|
|
|
|
|
comment on column iot_device.product_id is '所属产品';
|
|
|
|
|
|
|
|
comment on column iot_device.extend_params is '扩展配置';
|
|
|
|
|
|
|
|
comment on column iot_device.properties is '设备属性';
|
|
|
|
|
|
|
|
comment on column iot_device.create_by is '创建者';
|
|
|
|
|
|
|
|
comment on column iot_device.create_time is '创建时间';
|
|
|
|
|
|
|
|
comment on column iot_device.update_by is '更新者';
|
|
|
|
|
|
|
|
comment on column iot_device.update_time is '更新时间';
|
|
|
|
|
|
|
|
comment on column iot_device.remark is '备注';
|
|
|
|
|
2025-01-06 01:18:00 +08:00
|
|
|
comment on column iot_device.dept_id is '部门权限id';
|
|
|
|
|
2024-12-12 14:37:08 +08:00
|
|
|
alter table iot_device
|
|
|
|
owner to gitea;
|
|
|
|
|
2025-01-09 17:28:33 +08:00
|
|
|
r
|
|
|
|
table iot_device
|
|
|
|
owner to gitea;
|
|
|
|
|