Initial commit: 国土空间规划课程智能体 v1.0
单容器 Docker 架构的国土空间规划课程智能问答系统,集成 FastAPI 后端与 Next.js 前端。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- PostgreSQL数据库初始化脚本
|
||||
-- 为国土空间规划课程智能体创建扩展和配置
|
||||
|
||||
-- 创建扩展(如果需要)
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
|
||||
-- 设置数据库编码(lc_collate 和 lc_ctype 只能在创建数据库时设置,不能通过 ALTER DATABASE 修改)
|
||||
ALTER DATABASE course_agent_db SET client_encoding TO 'UTF8';
|
||||
|
||||
-- 创建表空间(可选)
|
||||
-- CREATE TABLESPACE course_agent_space LOCATION '/var/lib/postgresql/data';
|
||||
|
||||
-- 设置搜索路径
|
||||
ALTER DATABASE course_agent_db SET search_path TO public;
|
||||
|
||||
-- 创建用于监控的只读用户(可选)
|
||||
-- CREATE USER monitor WITH PASSWORD 'monitor_password';
|
||||
-- GRANT CONNECT ON DATABASE course_agent_db TO monitor;
|
||||
-- GRANT USAGE ON SCHEMA public TO monitor;
|
||||
-- GRANT SELECT ON ALL TABLES IN SCHEMA public TO monitor;
|
||||
|
||||
-- 设置连接限制
|
||||
ALTER DATABASE course_agent_db CONNECTION LIMIT 100;
|
||||
|
||||
-- 记录初始化完成
|
||||
COMMENT ON DATABASE course_agent_db IS '国土空间规划课程智能体数据库 - 初始化于 ' || current_timestamp;
|
||||
Reference in New Issue
Block a user