forked from wangziqi/gongxue-base
feat: establish production SaaS foundation
This commit is contained in:
@@ -37,9 +37,13 @@ Inbucket: http://127.0.0.1:54324
|
||||
|
||||
```bash
|
||||
npm run supabase:reset
|
||||
npm run db:smoke-seed
|
||||
npm run db:smoke-seed -- --confirm=SMOKE_SEED_LOCAL_OR_CI_ONLY
|
||||
```
|
||||
|
||||
`supabase:reset` 执行本地 `supabase/seed.sql`,会在 `app_private.environment_safety` 写入唯一的 `local/true` 标记。`smoke-seed` 还要求精确确认短语,两者缺一即在事务和任何持久化写入前拒绝。`npm run test:api`、`npm run test:rls` 和 `test:worker:*` 会通过受控 npm script 传入确认值,但仍必须通过数据库标记。
|
||||
|
||||
CI 或生产快照的隔离克隆库需由初始化流程显式写入 `environment='ci'` 或 `test`、`allow_destructive_tests=true`,并只授予测试数据库角色读取该标记的权限。生产和预发不得设置放行标记,也不得执行 `supabase/seed.sql`。
|
||||
|
||||
## API 服务
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user