/*
 Navicat Premium Dump SQL

 Source Server         : FnOS 80
 Source Server Type    : PostgreSQL
 Source Server Version : 150017 (150017)
 Source Host           : 10.8.8.80:5434
 Source Catalog        : log_platform
 Source Schema         : rcu_action

 Target Server Type    : PostgreSQL
 Target Server Version : 150017 (150017)
 File Encoding         : 65001

 Date: 10/03/2026 16:01:04
*/


-- ----------------------------
-- Table structure for rcu_action_events_g5
-- ----------------------------
DROP TABLE IF EXISTS "rcu_action"."rcu_action_events_g5";
CREATE TABLE "rcu_action"."rcu_action_events_g5" (
  "guid" int4 NOT NULL DEFAULT nextval('"rcu_action".rcu_action_events_g5_guid_seq1'::regclass),
  "ts_ms" int8 NOT NULL,
  "write_ts_ms" int8 NOT NULL,
  "hotel_id" int4 NOT NULL,
  "room_id" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "device_id" varchar(32) COLLATE "pg_catalog"."default" NOT NULL,
  "direction" varchar(10) COLLATE "pg_catalog"."default" NOT NULL,
  "cmd_word" varchar(10) COLLATE "pg_catalog"."default" NOT NULL,
  "frame_id" int4 NOT NULL,
  "udp_raw" text COLLATE "pg_catalog"."default" NOT NULL,
  "action_type" varchar(20) COLLATE "pg_catalog"."default" NOT NULL,
  "sys_lock_status" int2,
  "report_count" int2,
  "dev_type" int2,
  "dev_addr" int2,
  "dev_loop" int4,
  "dev_data" int4,
  "fault_count" int2,
  "error_type" int2,
  "error_data" int2,
  "type_l" int2,
  "type_h" int2,
  "details" jsonb,
  "extra" jsonb,
  "loop_name" varchar(255) COLLATE "pg_catalog"."default"
)
TABLESPACE "ts_hot"
;

-- ----------------------------
-- Indexes structure for table rcu_action_events_g5
-- ----------------------------
CREATE INDEX "idx_g5_prod_ts_ms" ON "rcu_action"."rcu_action_events_g5" USING btree (
  "ts_ms" "pg_catalog"."int8_ops" DESC NULLS FIRST
);

-- ----------------------------
-- Primary Key structure for table rcu_action_events_g5
-- ----------------------------
ALTER TABLE "rcu_action"."rcu_action_events_g5" ADD CONSTRAINT "rcu_action_events_g5_pkey" PRIMARY KEY ("ts_ms", "guid");
