Files
Neo-ZQYY/.cursor/rules/database.mdc
2026-05-02 03:11:39 +08:00

14 lines
565 B
Plaintext
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.
---
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。