Commit a67c1ffc authored by chonghaohao's avatar chonghaohao

fix

parent 85dd49fe
CREATE TABLE "public"."hs_asset_extension" (
"id" uuid NOT NULL,
"bg_images" varchar(100000) COLLATE "pg_catalog"."default",
"logo_icon" varchar(255) COLLATE "pg_catalog"."default",
"logo_images" varchar(1000000) COLLATE "pg_catalog"."default",
"created_user" uuid,
"created_time" int8 NOT NULL,
"updated_time" varchar(255) COLLATE "pg_catalog"."default",
"updated_user" uuid,
"tenant_id" uuid NOT NULL,
CONSTRAINT "hs_asset_extension_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_asset_extension"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_asset_extension"."id" IS '资产标识';
COMMENT ON COLUMN "public"."hs_asset_extension"."bg_images" IS '背景图片';
CREATE TABLE "public"."hs_customer_extension" (
"id" uuid NOT NULL,
"logo_icon" varchar(2000000) COLLATE "pg_catalog"."default",
"logo_images" varchar(1000000) COLLATE "pg_catalog"."default",
"remark" varchar(1000) COLLATE "pg_catalog"."default",
"tenant_id" uuid NOT NULL,
"updated_time" varchar(255) COLLATE "pg_catalog"."default",
"updated_user" uuid,
"created_time" varchar(255) COLLATE "pg_catalog"."default",
"created_user" uuid,
CONSTRAINT "hs_customer_extension_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_customer_extension"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_customer_extension"."id" IS '客户标识(工厂标识)';
CREATE TABLE "public"."hs_device_electric" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"peak" varchar(255) COLLATE "pg_catalog"."default",
"device_id" uuid,
"valley" varchar(255) COLLATE "pg_catalog"."default",
"day_used" varchar(255) COLLATE "pg_catalog"."default",
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
CONSTRAINT "hs_device_electric_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_electric" UNIQUE ("device_id", "time")
)
;
ALTER TABLE "public"."hs_device_electric"
OWNER TO "postgres";
CREATE INDEX "idx_device_electric_device" ON "public"."hs_device_electric" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_electric_factory" ON "public"."hs_device_electric" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_electric"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_electric"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_electric"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_electric"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_electric"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_device_electric"."peak" IS '峰用电';
COMMENT ON COLUMN "public"."hs_device_electric"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_electric"."valley" IS '谷用电';
COMMENT ON COLUMN "public"."hs_device_electric"."day_used" IS '总日用电';
COMMENT ON COLUMN "public"."hs_device_electric"."time" IS '时间';
COMMENT ON COLUMN "public"."hs_device_electric"."id" IS 'Id';
COMMENT ON COLUMN "public"."hs_device_electric"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_electric"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_electric"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_electric"."gateway_id" IS '网关id';
CREATE TABLE "public"."hs_device_electric_hour" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"peak" varchar(255) COLLATE "pg_catalog"."default",
"device_id" uuid,
"valley" varchar(255) COLLATE "pg_catalog"."default",
"hour_used" varchar(255) COLLATE "pg_catalog"."default",
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"hour_time" int8,
"value" varchar(255) COLLATE "pg_catalog"."default",
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
CONSTRAINT "hs_device_electric_hour_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_electric_hour" UNIQUE ("device_id", "hour_time")
)
;
ALTER TABLE "public"."hs_device_electric_hour"
OWNER TO "postgres";
CREATE INDEX "idx_device_electric_hour_device" ON "public"."hs_device_electric_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_electric_hour_factory" ON "public"."hs_device_electric_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_electric_hour"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."peak" IS '峰用电';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."valley" IS '谷用电';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."hour_used" IS '小时用电';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."time" IS '时间';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."hour_time" IS '小时';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."value" IS '值';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_electric_hour"."gateway_id" IS '网关id';
CREATE TABLE "public"."hs_device_extension" (
"id" uuid NOT NULL,
"workshop_id" uuid,
"group_id" uuid,
"picture" varchar(10000000) COLLATE "pg_catalog"."default",
"icon" varchar(255) COLLATE "pg_catalog"."default",
"created_user" uuid,
"updated_time" int8,
"updated_user" uuid,
"comment" varchar(255) COLLATE "pg_catalog"."default",
"sn" varchar(255) COLLATE "pg_catalog"."default",
"device_type" varchar(255) COLLATE "pg_catalog"."default",
"created_time" int8,
"factory_id" uuid,
"tenant_id" uuid NOT NULL,
CONSTRAINT "hs_device_ extension_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_device_extension"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_device_extension"."id" IS '设备标识';
COMMENT ON COLUMN "public"."hs_device_extension"."workshop_id" IS '车间标识';
COMMENT ON COLUMN "public"."hs_device_extension"."group_id" IS '分组标识';
COMMENT ON COLUMN "public"."hs_device_extension"."picture" IS '图片';
COMMENT ON COLUMN "public"."hs_device_extension"."icon" IS '图标';
COMMENT ON COLUMN "public"."hs_device_extension"."comment" IS '备注';
COMMENT ON COLUMN "public"."hs_device_extension"."device_type" IS '设备类型';
COMMENT ON COLUMN "public"."hs_device_extension"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_extension"."factory_id" IS '工厂标识(客户标识)';
COMMENT ON TABLE "public"."hs_device_extension" IS '设备信息扩展表';
CREATE TABLE "public"."hs_device_gas" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"day_used" varchar(255) COLLATE "pg_catalog"."default",
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
CONSTRAINT "hs_device_gas_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_gas" UNIQUE ("device_id", "time")
)
;
ALTER TABLE "public"."hs_device_gas"
OWNER TO "postgres";
CREATE INDEX "idx_device_gas_device" ON "public"."hs_device_gas" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_gas_factory" ON "public"."hs_device_gas" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_gas"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_gas"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_gas"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_gas"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_gas"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_device_gas"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_gas"."day_used" IS '总日用水';
COMMENT ON COLUMN "public"."hs_device_gas"."time" IS '时间';
COMMENT ON COLUMN "public"."hs_device_gas"."id" IS 'Id';
COMMENT ON COLUMN "public"."hs_device_gas"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_gas"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_gas"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_gas"."gateway_id" IS '网关id';
CREATE TABLE "public"."hs_device_gas_hour" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"hour_used" varchar(255) COLLATE "pg_catalog"."default",
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"hour_time" int8,
"value" varchar(255) COLLATE "pg_catalog"."default",
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
CONSTRAINT "hs_device_gas_hour_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_gas_hour" UNIQUE ("device_id", "hour_time")
)
;
ALTER TABLE "public"."hs_device_gas_hour"
OWNER TO "postgres";
CREATE INDEX "idx_device_gas_hour_device" ON "public"."hs_device_gas_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_gas_hour_factory" ON "public"."hs_device_gas_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_gas_hour"."value" IS '值';
COMMENT ON COLUMN "public"."hs_device_gas_hour"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_gas_hour"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_gas_hour"."gateway_id" IS '网关id';
CREATE TABLE "public"."hs_device_switch" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"off_line_time" int8,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
"off_switch_time" int8,
"on_switch_time" int8,
CONSTRAINT "hs_device_switch_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_switch" UNIQUE ("device_id", "time")
)
;
ALTER TABLE "public"."hs_device_switch"
OWNER TO "postgres";
CREATE INDEX "idx_device_switch_device" ON "public"."hs_device_switch" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_switch_factory" ON "public"."hs_device_switch" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_switch"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_switch"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_switch"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_switch"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_switch"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_device_switch"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_switch"."time" IS '时间';
COMMENT ON COLUMN "public"."hs_device_switch"."id" IS 'Id';
COMMENT ON COLUMN "public"."hs_device_switch"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_switch"."off_line_time" IS '离线时长';
COMMENT ON COLUMN "public"."hs_device_switch"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_switch"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_switch"."gateway_id" IS '网关id';
COMMENT ON COLUMN "public"."hs_device_switch"."off_switch_time" IS '停机时长';
COMMENT ON COLUMN "public"."hs_device_switch"."on_switch_time" IS '开机时长';
CREATE TABLE "public"."hs_device_switch_hour" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"device_id" uuid,
"hour_time" int8,
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"factory_id" uuid,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
"off_line_time" int8,
"off_switch_time" int8,
"on_switch_time" int8,
CONSTRAINT "hs_device_switch_hour_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_switch_hour" UNIQUE ("device_id", "hour_time")
)
;
ALTER TABLE "public"."hs_device_switch_hour"
OWNER TO "postgres";
CREATE INDEX "idx_device_switch_hour_device" ON "public"."hs_device_switch_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_switch_hour_factory" ON "public"."hs_device_switch_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_switch_hour"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."hour_time" IS '小时';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."time" IS '时间';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."id" IS 'Id';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."factory_id" IS '工厂Id';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."gateway_id" IS '网关id';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."off_line_time" IS '离线时长';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."off_switch_time" IS '停机时长';
COMMENT ON COLUMN "public"."hs_device_switch_hour"."on_switch_time" IS '开机时长';
CREATE TABLE "public"."hs_device_switch_trend" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"id" uuid NOT NULL,
"created_time" int8,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
"status" varchar(255) COLLATE "pg_catalog"."default",
"start_time" int8,
"end_time" int8,
CONSTRAINT "hs_device_switch_trend_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_device_switch_trend"
OWNER TO "postgres";
CREATE INDEX "idx_device_switch_trend" ON "public"."hs_device_switch_trend" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"start_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_switch_trend"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."id" IS 'Id';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."gateway_id" IS '网关id';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."status" IS '状态(OFF_LINE, OFF_SWITCH, ON_SWITCH)';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."start_time" IS '开始时间';
COMMENT ON COLUMN "public"."hs_device_switch_trend"."end_time" IS '结束时间';
CREATE TABLE "public"."hs_device_ts" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"num" int8,
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
CONSTRAINT "hs_device_ts_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_ts" UNIQUE ("device_id", "time")
)
;
ALTER TABLE "public"."hs_device_ts"
OWNER TO "postgres";
CREATE INDEX "idx_device_ts_device" ON "public"."hs_device_ts" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_ts_factory" ON "public"."hs_device_ts" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_ts"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_ts"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_ts"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_ts"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_ts"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_device_ts"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_ts"."num" IS '数量';
COMMENT ON COLUMN "public"."hs_device_ts"."time" IS '时间';
COMMENT ON COLUMN "public"."hs_device_ts"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_ts"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_ts"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_ts"."gateway_id" IS '网关id';
CREATE TABLE "public"."hs_device_ts_hour" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"num" int8,
"time" int8,
"hour_time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
"value" int8,
CONSTRAINT "hs_device_ts_hour_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_ts_hour" UNIQUE ("device_id", "hour_time")
)
;
ALTER TABLE "public"."hs_device_ts_hour"
OWNER TO "postgres";
CREATE INDEX "idx_device_ts_hour_device" ON "public"."hs_device_ts_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_ts_hour_factory" ON "public"."hs_device_ts_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_ts_hour"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_ts_hour"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_ts_hour"."gateway_id" IS '网关id';
COMMENT ON COLUMN "public"."hs_device_ts_hour"."value" IS '值';
CREATE TABLE "public"."hs_device_water" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"day_used" varchar(255) COLLATE "pg_catalog"."default",
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
CONSTRAINT "hs_device_water_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_water" UNIQUE ("device_id", "time")
)
;
ALTER TABLE "public"."hs_device_water"
OWNER TO "postgres";
CREATE INDEX "idx_device_water_device" ON "public"."hs_device_water" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_water_factory" ON "public"."hs_device_water" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_water"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_device_water"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_device_water"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_device_water"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_device_water"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_device_water"."device_id" IS '设备Id';
COMMENT ON COLUMN "public"."hs_device_water"."day_used" IS '总日用水';
COMMENT ON COLUMN "public"."hs_device_water"."time" IS '时间';
COMMENT ON COLUMN "public"."hs_device_water"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_device_water"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_water"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_water"."gateway_id" IS '网关id';
CREATE TABLE "public"."hs_device_water_hour" (
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"device_id" uuid,
"hour_used" varchar(255) COLLATE "pg_catalog"."default",
"time" int8,
"id" uuid NOT NULL,
"created_time" int8,
"hour_time" int8,
"value" varchar(255) COLLATE "pg_catalog"."default",
"group_id" uuid,
"workshop_id" uuid,
"gateway_id" uuid,
CONSTRAINT "hs_device_water_hour_pkey" PRIMARY KEY ("id"),
CONSTRAINT "uk_device_water_hour" UNIQUE ("device_id", "hour_time")
)
;
ALTER TABLE "public"."hs_device_water_hour"
OWNER TO "postgres";
CREATE INDEX "idx_device_water_hour_device" ON "public"."hs_device_water_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"device_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
CREATE INDEX "idx_device_water_hour_factory" ON "public"."hs_device_water_hour" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"hour_time" "pg_catalog"."int8_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_device_water_hour"."value" IS '值';
COMMENT ON COLUMN "public"."hs_device_water_hour"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_device_water_hour"."workshop_id" IS '车间id';
COMMENT ON COLUMN "public"."hs_device_water_hour"."gateway_id" IS '网关id';
CREATE TABLE "public"."hs_external_interface" (
"id" uuid NOT NULL,
"created_time" int8,
"created_user" uuid,
"tenant_id" uuid,
"updated_time" int8,
"updated_user" uuid,
"app_id" varchar(255) COLLATE "pg_catalog"."default",
"app_key" varchar(255) COLLATE "pg_catalog"."default",
"app_secret" varchar(255) COLLATE "pg_catalog"."default",
"apply_name" varchar(255) COLLATE "pg_catalog"."default",
"enable_status" bool,
"notes" varchar(255) COLLATE "pg_catalog"."default",
"project_describe" varchar(255) COLLATE "pg_catalog"."default",
"project_telephone" varchar(255) COLLATE "pg_catalog"."default",
"project_user" varchar(255) COLLATE "pg_catalog"."default",
"statistic_value" int8,
CONSTRAINT "hs_external_interface_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_external_interface"
OWNER TO "postgres";
CREATE TABLE "public"."hs_last_expand_extension" (
"key_id" int4 NOT NULL,
"entity_id" uuid NOT NULL,
"created_time" int8,
"tenant_id" uuid,
"updated_time" int8,
"device_name" varchar(255) COLLATE "pg_catalog"."default",
"device_type" varchar(255) COLLATE "pg_catalog"."default",
"enable" bool,
"factory_id" uuid,
"factory_name" varchar(255) COLLATE "pg_catalog"."default",
"gateway_id" uuid,
"gateway_name" varchar(255) COLLATE "pg_catalog"."default",
"group_id" uuid,
"group_name" varchar(255) COLLATE "pg_catalog"."default",
"history_lower" varchar(255) COLLATE "pg_catalog"."default",
"history_upper" varchar(255) COLLATE "pg_catalog"."default",
"key" varchar(255) COLLATE "pg_catalog"."default",
"unit_name" varchar(255) COLLATE "pg_catalog"."default",
"volume_on_day" int8,
"workshop_id" uuid,
"workshop_name" varchar(255) COLLATE "pg_catalog"."default",
CONSTRAINT "hs_last_expand_extension_pkey" PRIMARY KEY ("key_id", "entity_id")
)
;
ALTER TABLE "public"."hs_last_expand_extension"
OWNER TO "postgres";
COMMENT ON COLUMN "public"."hs_last_expand_extension"."key_id" IS 'keyId';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."entity_id" IS '设备id';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."created_time" IS '创建时间(表设计基础字段)';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."tenant_id" IS '租户id(表设计基础字段)';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."updated_time" IS '修改时间(表设计基础字段)';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."device_name" IS '设备名称';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."device_type" IS '0是设备,1是网关';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."enable" IS '是否启用(默认启用)';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."factory_name" IS '工厂名称';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."group_id" IS '分组id';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."group_name" IS '分组名称';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."history_lower" IS '历史最小值';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."history_upper" IS '历史最大值';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."key" IS '遥测的名称';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."unit_name" IS '单位名称';
COMMENT ON COLUMN "public"."hs_last_expand_extension"."volume_on_day" IS '当日遥测量(条数)';
CREATE TABLE "public"."hs_push_conf_table" (
"id" uuid NOT NULL,
"created_time" int8,
"created_user" uuid,
"tenant_id" uuid,
"updated_time" int8,
"updated_user" uuid,
"kafka_ip" varchar(255) COLLATE "pg_catalog"."default",
"kafka_names" varchar(255) COLLATE "pg_catalog"."default",
"kafka_port" varchar(255) COLLATE "pg_catalog"."default",
"kafka_status" bool,
"kafka_topic_pre" varchar(255) COLLATE "pg_catalog"."default",
"mqtt_ip" varchar(255) COLLATE "pg_catalog"."default",
"mqtt_port" varchar(255) COLLATE "pg_catalog"."default",
"mqtt_qos_type" varchar(255) COLLATE "pg_catalog"."default",
"mqtt_status" bool,
"mqtt_user_name" varchar(255) COLLATE "pg_catalog"."default",
"mqtt_password" varchar(255) COLLATE "pg_catalog"."default",
"notes" varchar(255) COLLATE "pg_catalog"."default",
"statistic_value" int8,
CONSTRAINT "hs_push_conf_table_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_push_conf_table"
OWNER TO "postgres";
CREATE TABLE "public"."hs_role" (
"id" uuid NOT NULL,
"created_time" int8,
"created_user" uuid,
"tenant_id" uuid,
"updated_time" int8,
"updated_user" uuid,
"role_code" varchar(255) COLLATE "pg_catalog"."default",
"role_desc" varchar(255) COLLATE "pg_catalog"."default",
"role_name" varchar(255) COLLATE "pg_catalog"."default",
"factory_id" uuid,
"system_tab" varchar(255) COLLATE "pg_catalog"."default",
"type" varchar(255) COLLATE "pg_catalog"."default",
"operation_type" int4 DEFAULT 0,
"user_level" int4 DEFAULT 0,
"virtual_code" int4,
CONSTRAINT "hs_role_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_role"
OWNER TO "postgres";
CREATE TABLE "public"."hs_weather" (
"id" uuid NOT NULL,
"created_time" int8,
"created_user" varchar(255) COLLATE "pg_catalog"."default",
"updated_time" int8,
"updated_user" varchar(255) COLLATE "pg_catalog"."default",
"tenant_id" uuid,
"factory_id" uuid,
"weather" varchar(255) COLLATE "pg_catalog"."default",
"temperature" varchar(255) COLLATE "pg_catalog"."default",
"wind_direction" varchar(255) COLLATE "pg_catalog"."default",
"wind_power" varchar(255) COLLATE "pg_catalog"."default",
"humidity" varchar(255) COLLATE "pg_catalog"."default",
"report_time_str" varchar(255) COLLATE "pg_catalog"."default",
"report_time" int8,
CONSTRAINT "hs_weather_pkey" PRIMARY KEY ("id")
)
;
ALTER TABLE "public"."hs_weather"
OWNER TO "postgres";
CREATE INDEX "idx_weather" ON "public"."hs_weather" USING btree (
"tenant_id" "pg_catalog"."uuid_ops" ASC NULLS LAST,
"factory_id" "pg_catalog"."uuid_ops" ASC NULLS LAST
);
COMMENT ON COLUMN "public"."hs_weather"."id" IS 'Id';
COMMENT ON COLUMN "public"."hs_weather"."created_time" IS '创建时间';
COMMENT ON COLUMN "public"."hs_weather"."created_user" IS '创建人';
COMMENT ON COLUMN "public"."hs_weather"."updated_time" IS '更新时间';
COMMENT ON COLUMN "public"."hs_weather"."updated_user" IS '更新人';
COMMENT ON COLUMN "public"."hs_weather"."tenant_id" IS '租户Id';
COMMENT ON COLUMN "public"."hs_weather"."factory_id" IS '工厂id';
COMMENT ON COLUMN "public"."hs_weather"."weather" IS '天气';
COMMENT ON COLUMN "public"."hs_weather"."temperature" IS '温度';
COMMENT ON COLUMN "public"."hs_weather"."wind_direction" IS '风向';
COMMENT ON COLUMN "public"."hs_weather"."wind_power" IS '风力';
COMMENT ON COLUMN "public"."hs_weather"."humidity" IS '湿度';
COMMENT ON COLUMN "public"."hs_weather"."report_time_str" IS '报告时间';
COMMENT ON COLUMN "public"."hs_weather"."report_time" IS '报告时间';
COMMENT ON TABLE "public"."hs_weather" IS '天气';
CREATE TABLE IF NOT EXISTS public.tb_menu
(
id uuid NOT NULL,
code character varying(255) COLLATE pg_catalog."default" NOT NULL,
name character varying(255) COLLATE pg_catalog."default",
level bigint NOT NULL,
sort bigint NOT NULL,
url character varying(1000) COLLATE pg_catalog."default",
parent_id uuid,
menu_icon character varying(255) COLLATE pg_catalog."default",
menu_images character varying(1000) COLLATE pg_catalog."default",
region character varying(255) COLLATE pg_catalog."default",
created_time bigint NOT NULL,
created_user uuid,
updated_time character varying(255) COLLATE pg_catalog."default",
updated_user uuid,
menu_type character varying(255) COLLATE pg_catalog."default",
path character varying(255) COLLATE pg_catalog."default" DEFAULT NULL::character varying,
is_button boolean DEFAULT false,
lang_key character varying(255) COLLATE pg_catalog."default"
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tb_menu
OWNER to postgres;
-- Table: public.tb_tenant_menu
-- DROP TABLE IF EXISTS public.tb_tenant_menu;
CREATE TABLE IF NOT EXISTS public.tb_tenant_menu
(
id uuid NOT NULL,
tenant_id uuid NOT NULL,
sys_menu_id uuid,
sys_menu_code character varying(255) COLLATE pg_catalog."default",
sys_menu_name character varying(255) COLLATE pg_catalog."default",
tenant_menu_name character varying(255) COLLATE pg_catalog."default",
tenant_menu_code character varying(255) COLLATE pg_catalog."default" NOT NULL,
level bigint NOT NULL,
sort bigint NOT NULL,
url character varying(1000) COLLATE pg_catalog."default",
parent_id uuid,
tenant_menu_icon character varying(255) COLLATE pg_catalog."default",
tenant_menu_images character varying(1000) COLLATE pg_catalog."default",
region character varying(255) COLLATE pg_catalog."default",
created_time bigint NOT NULL,
created_user uuid,
updated_time character varying(255) COLLATE pg_catalog."default",
updated_user uuid,
menu_type character varying(255) COLLATE pg_catalog."default",
path character varying(255) COLLATE pg_catalog."default" DEFAULT NULL::character varying,
is_button boolean DEFAULT false,
lang_key character varying(255) COLLATE pg_catalog."default",
has_children boolean DEFAULT false,
CONSTRAINT tb_tenant_menu_pkey PRIMARY KEY (id)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tb_tenant_menu
OWNER to postgres;
-- Table: public.tb_tenant_menu_role
-- DROP TABLE IF EXISTS public.tb_tenant_menu_role;
CREATE TABLE IF NOT EXISTS public.tb_tenant_menu_role
(
id uuid NOT NULL,
created_time bigint,
created_user uuid,
tenant_id uuid,
updated_time bigint,
updated_user uuid,
remark character varying(255) COLLATE pg_catalog."default",
tenant_menu_id uuid,
tenant_sys_role_id uuid,
flg character varying(255) COLLATE pg_catalog."default",
CONSTRAINT tb_tenant_menu_role_pkey PRIMARY KEY (id)
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.tb_tenant_menu_role
OWNER to postgres;
DROP TABLE IF EXISTS `api_auth`;
CREATE TABLE `api_auth`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`token_id` int(11) DEFAULT NULL,
`group_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `api_config`;
CREATE TABLE `api_config`
(
`id` varchar(255) NOT NULL,
`path` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`note` varchar(255) DEFAULT NULL,
`params` text,
`status` int(11) DEFAULT NULL,
`datasource_id` varchar(255) DEFAULT NULL,
`previlege` int(11) DEFAULT NULL,
`group_id` varchar(255) DEFAULT NULL,
`cache_plugin` varchar(255) DEFAULT NULL,
`cache_plugin_params` varchar(255) DEFAULT NULL,
`create_time` varchar(20) DEFAULT NULL,
`update_time` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `path` (`path`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `api_sql`;
CREATE TABLE `api_sql`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`api_id` varchar(11) NOT NULL,
`sql_text` text NOT NULL,
`transform_plugin` varchar(255) DEFAULT NULL,
`transform_plugin_params` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `api_group`;
CREATE TABLE `api_group`
(
`id` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `datasource`;
CREATE TABLE `datasource`
(
`id` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`note` varchar(255) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`driver` varchar(100) DEFAULT NULL,
`table_sql` varchar(255) DEFAULT NULL,
`create_time` varchar(20) DEFAULT NULL,
`update_time` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `firewall`;
CREATE TABLE `firewall`
(
`status` varchar(255) DEFAULT NULL,
`mode` varchar(255) DEFAULT NULL
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `ip_rules`;
CREATE TABLE `ip_rules`
(
`type` varchar(255) DEFAULT NULL,
`ip` varchar(10240) DEFAULT NULL
) ENGINE = InnoDB
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `token`;
CREATE TABLE `token`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(255) DEFAULT NULL,
`note` varchar(255) DEFAULT NULL,
`expire` bigint(20) DEFAULT NULL,
`create_time` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8;
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8;
insert into `firewall`(`status`, `mode`)
values ('off', 'black');
insert into `ip_rules`(`type`, `ip`)
values ('white', NULL),
('black', NULL);
insert into `user`(`id`, `username`, `password`)
values (1, 'admin', 'admin');
\ No newline at end of file
#
# XXL-JOB v2.4.0-SNAPSHOT
# Copyright (c) 2015-present, xuxueli.
CREATE database if NOT EXISTS `iot_job` default character set utf8mb4 collate utf8mb4_unicode_ci;
use `iot_job`;
SET NAMES utf8mb4;
CREATE TABLE `xxl_job_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
`job_desc` varchar(255) NOT NULL,
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`author` varchar(64) DEFAULT NULL COMMENT '作者',
`alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件',
`schedule_type` varchar(50) NOT NULL DEFAULT 'NONE' COMMENT '调度类型',
`schedule_conf` varchar(128) DEFAULT NULL COMMENT '调度配置,值含义取决于调度类型',
`misfire_strategy` varchar(50) NOT NULL DEFAULT 'DO_NOTHING' COMMENT '调度过期策略',
`executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
`executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
`executor_block_strategy` varchar(50) DEFAULT NULL COMMENT '阻塞处理策略',
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
`glue_type` varchar(50) NOT NULL COMMENT 'GLUE类型',
`glue_source` mediumtext COMMENT 'GLUE源代码',
`glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
`glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
`child_jobid` varchar(255) DEFAULT NULL COMMENT '子任务ID,多个逗号分隔',
`trigger_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '调度状态:0-停止,1-运行',
`trigger_last_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '上次调度时间',
`trigger_next_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '下次调度时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`job_group` int(11) NOT NULL COMMENT '执行器主键ID',
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
`executor_address` varchar(255) DEFAULT NULL COMMENT '执行器地址,本次执行的地址',
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
`executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
`executor_sharding_param` varchar(20) DEFAULT NULL COMMENT '执行器任务分片参数,格式如 1/2',
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
`trigger_time` datetime DEFAULT NULL COMMENT '调度-时间',
`trigger_code` int(11) NOT NULL COMMENT '调度-结果',
`trigger_msg` text COMMENT '调度-日志',
`handle_time` datetime DEFAULT NULL COMMENT '执行-时间',
`handle_code` int(11) NOT NULL COMMENT '执行-状态',
`handle_msg` text COMMENT '执行-日志',
`alarm_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败',
PRIMARY KEY (`id`),
KEY `I_trigger_time` (`trigger_time`),
KEY `I_handle_code` (`handle_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_log_report` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`trigger_day` datetime DEFAULT NULL COMMENT '调度-时间',
`running_count` int(11) NOT NULL DEFAULT '0' COMMENT '运行中-日志数量',
`suc_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
`fail_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `i_trigger_day` (`trigger_day`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_logglue` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`job_id` int(11) NOT NULL COMMENT '任务,主键ID',
`glue_type` varchar(50) DEFAULT NULL COMMENT 'GLUE类型',
`glue_source` mediumtext COMMENT 'GLUE源代码',
`glue_remark` varchar(128) NOT NULL COMMENT 'GLUE备注',
`add_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_registry` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`registry_group` varchar(50) NOT NULL,
`registry_key` varchar(255) NOT NULL,
`registry_value` varchar(255) NOT NULL,
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `i_g_k_v` (`registry_group`,`registry_key`,`registry_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app_name` varchar(64) NOT NULL COMMENT '执行器AppName',
`title` varchar(12) NOT NULL COMMENT '执行器名称',
`address_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '执行器地址类型:0=自动注册、1=手动录入',
`address_list` text COMMENT '执行器地址列表,多地址逗号分隔',
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL COMMENT '账号',
`password` varchar(50) NOT NULL COMMENT '密码',
`role` tinyint(4) NOT NULL COMMENT '角色:0-普通用户、1-管理员',
`permission` varchar(255) DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割',
PRIMARY KEY (`id`),
UNIQUE KEY `i_username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `xxl_job_lock` (
`lock_name` varchar(50) NOT NULL COMMENT '锁名称',
PRIMARY KEY (`lock_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `hs_api_job` (
`id` int NOT NULL AUTO_INCREMENT,
`job_id` int NOT NULL COMMENT '任务标识',
`api_id` varchar(255) NOT NULL COMMENT 'api标识',
`update_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Api调度任务';
INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`, `update_time`) VALUES (1, 'xxl-job-executor-sample', '示例执行器', 0, NULL, '2018-11-03 22:21:31' );
INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`, `update_time`) VALUES (4, 'dbapi-job-executor', 'DBAPI', 0, NULL, '2022-09-01 22:21:31' );
INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`) VALUES (1, 1, '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'CRON', '0 0 0 * * ? *', 'DO_NOTHING', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', '');
INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock');
commit;
......@@ -3,7 +3,7 @@ version: '3.9'
services:
zookeeper:
image: debezium/zookeeper:1.9.5.Final
image: 172.16.0.186:8084/huansiyl/debezium/zookeeper:1.9.5.Final
ports:
- "2181:2181"
- "2888:2888"
......@@ -11,7 +11,7 @@ services:
restart: always
kafka:
image: debezium/kafka:1.9.5.Final
image: 172.16.0.186:8084/huansiyl/debezium/kafka:1.9.5.Final
restart: always
ports:
- "9092:9092"
......@@ -26,7 +26,7 @@ services:
- KAFKA_INTER_BROKER_LISTENER_NAME=LISTENER_INT
connect:
image: debezium/connect:1.9.5.Final
image: 172.16.0.186:8084/huansiyl/debezium/connect:1.9.5.Final
restart: always
ports:
- "8083:8083"
......
......@@ -53,12 +53,12 @@ checkFolders --create || exit $?
if [ ! -z "${ADDITIONAL_STARTUP_SERVICES// }" ]; then
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
up -d $ADDITIONAL_STARTUP_SERVICES
fi
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
run --no-deps --rm -e INSTALL_TB=true -e LOAD_DEMO=${loadDemo} \
tb-core1
......
......@@ -28,5 +28,5 @@ ADDITIONAL_CACHE_ARGS=$(additionalComposeCacheArgs) || exit $?
ADDITIONAL_COMPOSE_MONITORING_ARGS=$(additionalComposeMonitoringArgs) || exit $?
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS $ADDITIONAL_COMPOSE_MONITORING_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS $ADDITIONAL_COMPOSE_MONITORING_ARGS \
down -v
......@@ -30,5 +30,5 @@ ADDITIONAL_COMPOSE_MONITORING_ARGS=$(additionalComposeMonitoringArgs) || exit $?
checkFolders --create || exit $?
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS $ADDITIONAL_COMPOSE_MONITORING_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS $ADDITIONAL_COMPOSE_MONITORING_ARGS \
up -d
......@@ -28,5 +28,5 @@ ADDITIONAL_CACHE_ARGS=$(additionalComposeCacheArgs) || exit $?
ADDITIONAL_COMPOSE_MONITORING_ARGS=$(additionalComposeMonitoringArgs) || exit $?
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS $ADDITIONAL_COMPOSE_MONITORING_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS $ADDITIONAL_COMPOSE_MONITORING_ARGS \
stop
......@@ -26,8 +26,8 @@ ADDITIONAL_COMPOSE_ARGS=$(additionalComposeArgs) || exit $?
ADDITIONAL_CACHE_ARGS=$(additionalComposeCacheArgs) || exit $?
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
pull $@
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
up -d --no-deps --build $@
......@@ -51,15 +51,15 @@ ADDITIONAL_STARTUP_SERVICES=$(additionalStartupServices) || exit $?
checkFolders --create || exit $?
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
pull \
tb-core1
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
up -d $ADDITIONAL_STARTUP_SERVICES
docker-compose \
-f docker-compose.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
-f docker-compose.yml -f docker-compose-debezium.yml -f docker-compose.iot-business.yml $ADDITIONAL_CACHE_ARGS $ADDITIONAL_COMPOSE_ARGS $ADDITIONAL_COMPOSE_QUEUE_ARGS \
run --no-deps --rm -e UPGRADE_TB=true -e FROM_VERSION=${fromVersion} \
tb-core1
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