Uh oh!
There was an error while loading. Please reload this page.
docs: backend/AGENTS.md — 改 DB schema 前必查全新贡献者能否启动 - #45
Merged
Conversation
把 M0 踩的坑固化成硬约束:三处 schema(schema.sql / docker/init-db/init.sql / test-schema.sql)必须同步(CREATE TABLE IF NOT EXISTS 补不上已存在表的缺列)、 schema.sql 的 DML 必须幂等、不许把 SPRING_SQL_INIT_MODE 改成 never、不许直接 敲生产库;附一次性 throwaway 容器跑 init→schema 两遍的验证配方,杜绝"我这能跑" 式自证。
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 freeto 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.
把 M0(#43)踩的坑固化成给 AI / contributor 的硬约束,独立于功能栈,可直接合。
起因
M0 的
user_identities回填读user_accounts.github_id,但docker/init-db/init.sql建的表缺 github_id 等列,
schema.sql的CREATE TABLE IF NOT EXISTS又补不上——全新贡献者
docker compose up首启直接column "github_id" does not exist崩,后端起不来。改数据库的人(我)在自己早有那些列的库上完全看不见这个问题。
这个 AGENTS.md 要求什么
SPRING_SQL_INIT_MODE=never(新表在本地会缺)exit 0才算过——只在既有服务器库上测不算数(它藏住了 init.sql 的分裂)
配合根 CLAUDE.md 与 SECURITY.md 阅读;backend 此前没有自己的 agent 指令文件。
🤖 Generated with Claude Code
https://claude.ai/code/session_01RtSNVtrEkCsFVHrbt4Zjgi