迁移 Claude/Codex/Cursor 开发环境与追溯资产

Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Neo
2026-05-02 03:11:39 +08:00
parent d269ee6401
commit 81e41730ec
33 changed files with 3734 additions and 34 deletions

View File

@@ -0,0 +1,13 @@
---
description: 数据库规则schema 变更、RLS 双 schema、文档同步和验证 SQL。
globs: db/**,docs/database/**
alwaysApply: false
---
# 数据库规则
- 任何 PostgreSQL schema/迁移/DDL/ORM 结构变更必须同步 `docs/database/`。
- 新建 DWS/DWD RLS 视图必须同时创建原 schema 和 `app` schema 视图。
- 回滚需逆序 DROP/ALTER并提供至少 3 条验证 SQL。
- 默认使用 `TEST_DB_DSN` / `TEST_APP_DB_DSN`,禁止连正式库。
- DDL 基线变更后运行 `tools/db/gen_consolidated_ddl.py` 并同步权威 DDL。