/*
 Navicat Premium Dump SQL

 Source Server         : 智能控制平台
 Source Server Type    : PostgreSQL
 Source Server Version : 150013 (150013)
 Source Host           : 10.10.10.9:5432
 Source Catalog        : ktor2
 Source Schema         : public

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

 Date: 18/09/2025 16:09:46
*/


-- ----------------------------
-- Table structure for ai_chat_profiles
-- ----------------------------
DROP TABLE IF EXISTS "public"."ai_chat_profiles";
CREATE TABLE "public"."ai_chat_profiles" (
  "id" uuid NOT NULL DEFAULT gen_random_uuid(),
  "title" varchar(100) COLLATE "pg_catalog"."default",
  "ai_personality" json NOT NULL DEFAULT '{}'::json,
  "welcome_words" varchar(100) COLLATE "pg_catalog"."default",
  "created_at" timestamptz(6),
  "is_active" bool DEFAULT true,
  "available_roles" json NOT NULL,
  "available_module" varchar(255) COLLATE "pg_catalog"."default",
  "available_report_tables" json,
  "description" varchar(255) COLLATE "pg_catalog"."default",
  "updated_at" timestamptz(6),
  "updated_by" uuid,
  "created_by" uuid,
  "available_kn_bases" json
)
;
COMMENT ON COLUMN "public"."ai_chat_profiles"."id" IS '主键';
COMMENT ON COLUMN "public"."ai_chat_profiles"."title" IS '标题';
COMMENT ON COLUMN "public"."ai_chat_profiles"."ai_personality" IS '综合描述（性格、业务等内容）';
COMMENT ON COLUMN "public"."ai_chat_profiles"."welcome_words" IS '欢迎词';
COMMENT ON COLUMN "public"."ai_chat_profiles"."created_at" IS '创建时间';
COMMENT ON COLUMN "public"."ai_chat_profiles"."is_active" IS '是否可用';
COMMENT ON COLUMN "public"."ai_chat_profiles"."available_roles" IS '该Ai所属用户角色';
COMMENT ON COLUMN "public"."ai_chat_profiles"."available_module" IS '该AI所属模块';
COMMENT ON COLUMN "public"."ai_chat_profiles"."available_report_tables" IS '该AI可用的数据库列表';
COMMENT ON COLUMN "public"."ai_chat_profiles"."description" IS '描述';
COMMENT ON COLUMN "public"."ai_chat_profiles"."updated_at" IS '更新时间';
COMMENT ON COLUMN "public"."ai_chat_profiles"."updated_by" IS '更新人，外键，用户表主键';
COMMENT ON COLUMN "public"."ai_chat_profiles"."created_by" IS '创建人，外键，用户表主键';
COMMENT ON COLUMN "public"."ai_chat_profiles"."available_kn_bases" IS '该AI可用的知识库列表';
COMMENT ON TABLE "public"."ai_chat_profiles" IS 'AI对话智能体';

-- ----------------------------
-- Primary Key structure for table ai_chat_profiles
-- ----------------------------
ALTER TABLE "public"."ai_chat_profiles" ADD CONSTRAINT "ai_profiles_pkey" PRIMARY KEY ("id");
