CREATE TABLE modbus_server_point (
    id           SERIAL PRIMARY KEY,

    point_id     VARCHAR(128) NOT NULL,
    name         VARCHAR(128) NOT NULL,

    data_type    VARCHAR(16) NOT NULL CHECK (
        data_type IN ('int16', 'int32', 'float32')
    ),

    slave_id     INTEGER NOT NULL CHECK (slave_id BETWEEN 1 AND 247),
    address      INTEGER NOT NULL CHECK (address >= 0),

    create_time  TIMESTAMPTZ NOT NULL DEFAULT now(),
    update_time  TIMESTAMPTZ NOT NULL DEFAULT now(),

    CONSTRAINT uk_modbus_point_point_id UNIQUE (point_id),
    CONSTRAINT uk_modbus_point_slave_address UNIQUE (slave_id, address)
);