Files
Web_BLS_OnOffLine_Server/bls-onoffline-backend/README.md
XuJiacheng 33c9bf0e07 refactor: 移除运行时数据库初始化与分区维护
- 删除了服务启动阶段的数据库初始化逻辑,包括创建数据库、表和分区的相关代码。
- 移除了定时分区维护任务,确保服务职责更清晰。
- 更新了数据库分区策略,明确分区由外部脚本管理,服务不再自动创建缺失分区。
- 修改了相关文档,确保数据库结构与分区维护的责任转移到 `SQL_Script/` 目录下的外部脚本。
- 更新了需求和场景,确保符合新的设计规范。
2026-03-04 11:52:12 +08:00

31 lines
856 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
bls-onoffline-backend
安装与运行
- Node.js 22+
- npm install
- npm run dev
构建与测试
- npm run build
- npm run test
- npm run lint
规范校验
- npm run spec:lint
- npm run spec:validate
环境变量
- 复制 .env.example 为 .env 并按实际环境配置
数据库初始化
- 运行服务前请先通过根目录 SQL_Script 下脚本完成建库与分区维护
- `../SQL_Script/create_database.sql`建库psql
- `../SQL_Script/create_schema_and_parent_table.sql`:建 schema 与主分区表
- `../SQL_Script/create_partition_for_day.sql`:按日建分区模板
- `../SQL_Script/generate_init_sql.js`:生成建库+建表 SQL
- `../SQL_Script/generate_partition_sql.js`:生成单日分区 SQL
- `../SQL_Script/generate_partition_range_sql.js`:生成批量分区 SQL
规范说明
- 规格文件位于 spec/onoffline-spec.md