- 0.1–0.9 全部标为完成,但不是"代码写完"就算完成: 33 条测试全绿、ruff/format 通过、真机 uvicorn 冒烟(/health /version 登录 建工作区 列表 /auth/me)通过 之后才敢打勾;没跑过的(downgrade、mypy、CI 在 Gitea 实跑、Web/Android 联调)保持未勾并写明原因。 - 记录 5 处"计划与实际不符"的偏差及理由: JWT 30min/14d、refresh 无状态不可撤销、权限用 ROLE_RANK 而非 PERMISSIONS 字典、 app_user 故意不加 RLS(登录发生在租户绑定之前)、minio 与 pgvector 推迟到 M3。 - 新增「环境现状与阻塞」一节:Docker 起不来用便携 PG、外网 TLS 被拦走 HTTP 镜像、 pip 必须 --no-cache-dir(否则写缓存卡死)、pg_ctl restricted token 报错、fnsvr-01 只有 8418/3306。 - 验收用例表加"现状"列,区分已验证 / 部分 / 未做。 顺带修: - alembic downgrade 之前直接失败:workspace 的 RLS 策略引用了 member, 不先 DROP POLICY 就 drop table,报 "cannot drop table member because other objects depend on it"。 现已按策略先删后删表,downgrade base → upgrade head 全通。 - npm 依赖必须 --ignore-scripts 才能装(沙箱禁止 lifecycle 脚本派生进程), 已写进 DEVELOPMENT.md;web 首次构建成功(tsc -b + vite,177KB/gzip 58KB)。 验收:pytest 33 passed / ruff 干净 / alembic 升降级往返通过 / web build 通过。
This commit is contained in:
@@ -208,6 +208,15 @@ def upgrade() -> None:
|
||||
|
||||
def downgrade() -> None:
|
||||
op.execute(f"REVOKE ALL ON workspace, app_user, member, invitation, audit_log FROM {APP_ROLE};")
|
||||
# 必须先删策略:workspace 的策略里引用了 member,直接 drop 表会报
|
||||
# "cannot drop table member because other objects depend on it"。
|
||||
for table, policy in (
|
||||
("workspace", "workspace_isolation"),
|
||||
("member", "member_isolation"),
|
||||
("invitation", "invitation_isolation"),
|
||||
("audit_log", "audit_log_isolation"),
|
||||
):
|
||||
op.execute(f"DROP POLICY IF EXISTS {policy} ON {table};")
|
||||
op.drop_table("audit_log")
|
||||
op.drop_table("invitation")
|
||||
op.drop_table("member")
|
||||
|
||||
Reference in New Issue
Block a user