/*
 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:10:07
*/


-- ----------------------------
-- Table structure for ai_reports
-- ----------------------------
DROP TABLE IF EXISTS "public"."ai_reports";
CREATE TABLE "public"."ai_reports" (
  "id" uuid NOT NULL DEFAULT gen_random_uuid(),
  "title" varchar(255) COLLATE "pg_catalog"."default",
  "sql" text COLLATE "pg_catalog"."default",
  "created_at" timestamptz(6),
  "created_by" uuid,
  "is_masked" bool NOT NULL
)
;
COMMENT ON COLUMN "public"."ai_reports"."id" IS '主键';
COMMENT ON COLUMN "public"."ai_reports"."title" IS '报表名称';
COMMENT ON COLUMN "public"."ai_reports"."sql" IS 'SQL语句';
COMMENT ON COLUMN "public"."ai_reports"."created_at" IS '创建时间';
COMMENT ON COLUMN "public"."ai_reports"."created_by" IS '创建者';
COMMENT ON COLUMN "public"."ai_reports"."is_masked" IS '是否收藏';
COMMENT ON TABLE "public"."ai_reports" IS 'AI报表记录';

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