create table iot_device
(
    id               bigserial not null
        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    varchar,
    properties       varchar,
    create_by        varchar,
    create_time      timestamp,
    update_by        varchar,
    update_time      timestamp,
    remark           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 '备注';

alter table iot_device
    owner to gitea;


