/*
 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:53
*/


-- ----------------------------
-- Table structure for ai_chat_sessions
-- ----------------------------
DROP TABLE IF EXISTS "public"."ai_chat_sessions";
CREATE TABLE "public"."ai_chat_sessions" (
  "id" uuid NOT NULL DEFAULT gen_random_uuid(),
  "user_id" uuid,
  "title" varchar(255) COLLATE "pg_catalog"."default",
  "created_at" timestamptz(6),
  "updated_at" timestamptz(6),
  "ai_id" uuid,
  "available_module" varchar(255) COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."ai_chat_sessions"."id" IS '主键';
COMMENT ON COLUMN "public"."ai_chat_sessions"."user_id" IS '所属用户';
COMMENT ON COLUMN "public"."ai_chat_sessions"."title" IS '对话标题';
COMMENT ON COLUMN "public"."ai_chat_sessions"."created_at" IS '创建时间';
COMMENT ON COLUMN "public"."ai_chat_sessions"."updated_at" IS '更新时间';
COMMENT ON COLUMN "public"."ai_chat_sessions"."ai_id" IS '外键，对话智能体主键';
COMMENT ON COLUMN "public"."ai_chat_sessions"."available_module" IS '该对话所属功能模块';
COMMENT ON TABLE "public"."ai_chat_sessions" IS 'AI对话会话';

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