Commit 01ca0f31 authored by 吴文龙's avatar 吴文龙

整理PG语句

parent 1c8ffdf0
This diff is collapsed.
This diff is collapsed.
CREATE TABLE "public"."hs_device_order_statistical" (
"id" uuid NOT NULL,
"device_id" uuid NOT NULL,
"order_no" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"statistic_val" numeric(10,4),
"current_val" varchar(255) COLLATE "pg_catalog"."default",
"first_val" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"order_status" varchar(255) COLLATE "pg_catalog"."default" DEFAULT 'underway'::character varying,
"device_name" varchar(255) COLLATE "pg_catalog"."default",
"order_array" varchar(1000) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"start_time" timestamp(6),
"end_time" timestamp(6),
"created_time" int8,
"updated_time" int8 NOT NULL,
CONSTRAINT "hs_device_order_statistical_pkey" PRIMARY KEY ("id"),
CONSTRAINT "hs_device_order_statistical_device_id_order_no_code_key" UNIQUE ("device_id", "order_no", "code")
)
;
ALTER TABLE "public"."hs_device_order_statistical"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_device_order_statistical"."device_id" IS '设备标识';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."order_no" IS '订单号';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."code" IS 'water-水;electric-电;vapor-蒸汽;output-产量';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."statistic_val" IS '统计值';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."current_val" IS '采集值';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."first_val" IS '订单开始时首次采集值';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."order_status" IS '订单状态(underway-进行中;close-结束)';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."device_name" IS '设备名称';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."order_array" IS '订单明细';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."tenant_id" IS '租户标识';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."start_time" IS '开始时间';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."end_time" IS '结束时间';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."created_time" IS '创建时间戳';
COMMENT ON COLUMN "public"."hs_device_order_statistical"."updated_time" IS '修改时间戳';
COMMENT ON TABLE "public"."hs_device_order_statistical" IS '统计设备订单的能耗产量(kafka)';
CREATE TABLE "public"."hs_order_statistical" (
"id" uuid NOT NULL,
"order_no" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"order_status" varchar(255) COLLATE "pg_catalog"."default" DEFAULT 'underway'::character varying,
"code" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"statistic_val" numeric(10,4) NOT NULL DEFAULT 0,
"start_time" timestamp(6),
"end_time" timestamp(6),
"created_time" int8,
"updated_time" int8 NOT NULL,
"tenant_id" uuid NOT NULL,
"order_array" varchar(1000) COLLATE "pg_catalog"."default",
CONSTRAINT "hs_order_statistical_pkey" PRIMARY KEY ("id"),
CONSTRAINT "hs_order_statistical_order_no_code_key" UNIQUE ("order_no", "code")
)
;
ALTER TABLE "public"."hs_order_statistical"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_order_statistical"."order_status" IS '订单状态(underway-进行中;close-结束)';
COMMENT ON COLUMN "public"."hs_order_statistical"."code" IS 'water-水;electric-电;vapor-蒸汽;output-产量';
COMMENT ON COLUMN "public"."hs_order_statistical"."statistic_val" IS '统计值';
COMMENT ON COLUMN "public"."hs_order_statistical"."tenant_id" IS '租户标识';
COMMENT ON COLUMN "public"."hs_order_statistical"."order_array" IS '订单明细';
COMMENT ON TABLE "public"."hs_order_statistical" IS '统计订单的能耗产量(kafka)';
ALTER TABLE hs_customer_extension ADD COLUMN "sort" int4 DEFAULT 1000;
ALTER TABLE tcode_group ADD COLUMN "id" uuid NOT NULL;
ALTER TABLE tcode_group ADD CONSTRAINT "tcode_group_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Table structure for hs_db_conf
-- ----------------------------
DROP TABLE IF EXISTS "public"."hs_db_conf";
CREATE TABLE "public"."hs_db_conf" (
"id" uuid NOT NULL,
"created_time" int8,
"tenant_id" uuid NOT NULL,
"host" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"port" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"user" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"password" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"database" varchar(255) COLLATE "pg_catalog"."default" NOT NULL
)
;
ALTER TABLE "public"."hs_db_conf" OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_db_conf"."id" IS '设备标识';
COMMENT ON COLUMN "public"."hs_db_conf"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_db_conf"."tenant_id" IS '租户';
COMMENT ON COLUMN "public"."hs_db_conf"."host" IS '地址';
COMMENT ON COLUMN "public"."hs_db_conf"."port" IS '端口';
COMMENT ON COLUMN "public"."hs_db_conf"."user" IS '用户';
COMMENT ON COLUMN "public"."hs_db_conf"."password" IS '密码';
COMMENT ON COLUMN "public"."hs_db_conf"."database" IS '数据库';
COMMENT ON TABLE "public"."hs_db_conf" IS '租户同步数据到对应数据库配置表';
-- ----------------------------
-- Primary Key structure for table hs_db_conf
-- ----------------------------
ALTER TABLE "public"."hs_db_conf" ADD CONSTRAINT "hs_device_syn_conf_copy1_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Table structure for hs_board_manage
-- ----------------------------
DROP TABLE IF EXISTS "public"."hs_board_manage";
CREATE TABLE "public"."hs_board_manage" (
"id" uuid NOT NULL,
"name" varchar(255) COLLATE "pg_catalog"."default",
"url" varchar(255) COLLATE "pg_catalog"."default",
"images" varchar(10000000) COLLATE "pg_catalog"."default",
"created_time" int8,
"created_user" uuid,
"tenant_id" uuid,
"updated_time" int8,
"updated_user" uuid,
"sort" int4 DEFAULT 0
)
;
ALTER TABLE "public"."hs_board_manage" OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_board_manage"."name" IS '看板名称';
COMMENT ON COLUMN "public"."hs_board_manage"."url" IS '看板地址';
COMMENT ON COLUMN "public"."hs_board_manage"."images" IS '看板缩略图';
COMMENT ON COLUMN "public"."hs_board_manage"."sort" IS '排序值';
COMMENT ON TABLE "public"."hs_board_manage" IS '看板配置管理';
-- ----------------------------
-- Table structure for hs_board_manage_role
-- ----------------------------
DROP TABLE IF EXISTS "public"."hs_board_manage_role";
CREATE TABLE "public"."hs_board_manage_role" (
"id" uuid NOT NULL,
"board_id" uuid,
"role_id" uuid,
"images" varchar(10000000) COLLATE "pg_catalog"."default",
"created_time" int8,
"created_user" uuid,
"tenant_id" uuid,
"updated_time" int8,
"updated_user" uuid
)
;
ALTER TABLE "public"."hs_board_manage_role" OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_board_manage_role"."id" IS '主键';
COMMENT ON COLUMN "public"."hs_board_manage_role"."board_id" IS '看板标识';
COMMENT ON COLUMN "public"."hs_board_manage_role"."role_id" IS '角色标识';
COMMENT ON COLUMN "public"."hs_board_manage_role"."images" IS '看板缩略图';
COMMENT ON TABLE "public"."hs_board_manage_role" IS '看板角色关系';
-- ----------------------------
-- Primary Key structure for table hs_board_manage
-- ----------------------------
ALTER TABLE "public"."hs_board_manage" ADD CONSTRAINT "hs_board_manage_pkey" PRIMARY KEY ("id");
-- ----------------------------
-- Primary Key structure for table hs_board_manage_role
-- ----------------------------
ALTER TABLE "public"."hs_board_manage_role" ADD CONSTRAINT "hs_board_manage_copy1_pkey" PRIMARY KEY ("id");
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -23,5 +23,3 @@ services:
volumes:
cassandra-volume:
external: true
name: ${CASSANDRA_DATA_VOLUME}
......@@ -25,8 +25,10 @@ services:
environment:
POSTGRES_DB: hsiotdb
POSTGRES_PASSWORD: huansi.net@v3
command: -c config_file=/etc/postgresql/postgresql.conf
volumes:
- ./tb-node/postgres:/var/lib/postgresql/data
- ./db/postgresql.conf:/etc/postgresql/postgresql.conf
cassandra:
restart: always
image: "cassandra:4.0.4"
......
......@@ -23,5 +23,3 @@ services:
volumes:
postgres-db-volume:
external: true
name: ${POSTGRES_DATA_VOLUME}
......@@ -25,8 +25,10 @@ services:
environment:
POSTGRES_DB: hsiotdb
POSTGRES_PASSWORD: huansi.net@v3
command: -c config_file=/etc/postgresql/postgresql.conf
volumes:
- ./tb-node/postgres:/var/lib/postgresql/data
- ./db/postgresql.conf:/etc/postgresql/postgresql.conf
tb-core1:
env_file:
- tb-node.postgres.env
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment