refactor: 应用 Oracle round-4 复核,硬化 migrator 与默认安全值

- migrate: 校验已应用 migration 的 SHA-256,拒绝 schema drift;
  split 后 trim + skip empty,避免空 statement 触发 SQL 错误
- todo.contract: update 拒绝空 patch
- env: DATABASE_URL 限定 postgres(ql):// scheme,配置错误更早失败
- compile: autoloadDotenv: false,二进制部署不再吞 cwd 的 .env
- Error.tsx: 生产环境隐藏 error.message,避免内部错误泄露
- AGENTS: 同步 generatedFieldKeys / migrator 行为新描述
This commit is contained in:
2026-04-25 14:38:44 +08:00
parent 695e826dcf
commit ed257fe4e6
6 changed files with 33 additions and 14 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import { z } from 'zod'
export const env = createEnv({
server: {
DATABASE_URL: z.url(),
DATABASE_URL: z.url({ protocol: /^postgres(ql)?$/ }),
},
clientPrefix: 'VITE_',
client: {},