create table iot_device
(
    id            bigserial
        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,
    extend_params jsonb,
    properties    jsonb,
    create_by        varchar,
    create_time      timestamp,
    update_by        varchar,
    update_time      timestamp,
    remark        varchar,
    dept_id       bigint,
    create_id     bigint,
    longitude     double precision,
    latitude      double precision,
    icon          varchar
);

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 '备注';

comment on column iot_device.dept_id is '部门权限id';

comment on column iot_device.create_id is '创建者id';

comment on column iot_device.longitude is '设备经度';

comment on column iot_device.latitude is '设备纬度';

comment on column iot_device.icon is '设备图标';

alter table iot_device
    owner to gitea;

