fix(safety): 数据库安全防护 - 防止跨项目数据丢失#84
Open
dav-niu474 wants to merge 1 commit into
Open
Conversation
- Add explicit safety comments about not using --accept-data-loss - Add fallback message directing to /api/migrate for fresh databases - Document that /api/migrate route handles schema changes safely - Prevent accidental data destruction during build
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
另一个项目
magic-story-ai的 Prisma schema 包含schemas = ["magic_story", "public"],当运行
prisma migrate或prisma db push时,执行了DROP SCHEMA public CASCADE,导致 huobao-drama-ai 的所有数据被销毁。
数据库中检测到
DROP SCHEMA "public" CASCADE被执行了 9 次。证据
pg_stat_statements显示DROP SCHEMA "public" CASCADE执行了 9 次_prisma_migrations中有20260611064636_init_magic_story_schema迁移记录(2026-06-11 06:46 UTC)"public"from schemas 列表)修复内容
"public",只保留"magic_story"--accept-data-loss数据恢复方式