Skip to content

Document migration workflow in .claude/CLAUDE.md#7689

Open
Hinton wants to merge 2 commits into
mainfrom
claude-db
Open

Document migration workflow in .claude/CLAUDE.md#7689
Hinton wants to merge 2 commits into
mainfrom
claude-db

Conversation

@Hinton
Copy link
Copy Markdown
Member

@Hinton Hinton commented May 21, 2026

🎟️ Tracking

📔 Objective

Adds a Migrations section covering the dual Dapper/EF tracks, paths to the SSDT project and DbScripts, links to the contributing-docs MSSQL migration and SQL code style guides, and the local commands for applying migrations and regenerating EF migrations across all three providers.

Adds a Migrations section covering the dual Dapper/EF tracks, paths to the
SSDT project and DbScripts, links to the contributing-docs MSSQL migration
and SQL code style guides, and the local commands for applying migrations
and regenerating EF migrations across all three providers.
@Hinton Hinton requested a review from a team as a code owner May 21, 2026 14:58
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.49%. Comparing base (59ded30) to head (8456091).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7689      +/-   ##
==========================================
+ Coverage   60.20%   60.49%   +0.29%     
==========================================
  Files        2137     2141       +4     
  Lines       94412    94654     +242     
  Branches     8409     8456      +47     
==========================================
+ Hits        56840    57261     +421     
+ Misses      35580    35388     -192     
- Partials     1992     2005      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread .claude/CLAUDE.md
- OpenTelemetry for observability (ADR 0020)
- Log to standard output (ADR 0021)

## Migrations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓Is this information Claude always needs, or only when dealing with schema changes? If the latter, can we convert this to a new Skill, or fold it into writing-database-queries?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only with db schemes. Not sure if the skill was triggered or not but if it was it is in-sufficient. I observed. the following defects.

  • Hand wrote MySQL migration because the docker wasn't running. This should be forbidden.
  • Used the wrong T-SQL syntax.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Can we verify if it was invoked, and if the instructions need to be updated? If it wasn't invoked when you expected we should be able to adjust the skill's description or when_to_use fields to improve hits from natural language and inference.

Copy link
Copy Markdown
Member Author

@Hinton Hinton May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I do that? If you want to take ownership of bringing in this change that's fine too, I just don't want this happening again.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am of the opinon that the majority of the contributions below are important enough to add to the root CLAUDE.md. They are surgical and direct instructions for Claude.

I have a couple small recommendations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am of the opinon that the majority of the contributions below are important enough to add to the root CLAUDE.md. They are surgical and direct instructions for Claude.

"Changing the DB schema" is only needed in specific circumstances, so putting it in CLAUDE.md directly contradicts the CONTRIBUTING.md guidelines that were just added to all of our repos.123

A lot of this section is already covered in the existing db related skills. Regardless of where it ultimately lands, it should not be duplicated in multiple places. Either move the existing skill content to CLAUDE.md or move the net-new content, here, to those skills.

If Claude is failing to invoke those Skills there are other approaches we can take to address that problem, like expanding the description, adding when_to_use, or adding a reference + usage table with instructions for using repo-specific skills here in CLAUDE.md. The latter option has value beyond sessions scoped to this repo, but is not in scope for this PR, so I recommend it as a separate follow-up to address that regardless of the decision of where to put this new information.

Footnotes

  1. https://github.com/bitwarden/server/blob/main/.claude/CONTRIBUTING.md?plain=1#L21

  2. https://github.com/bitwarden/server/blob/main/.claude/CONTRIBUTING.md?plain=1#L34

  3. https://github.com/bitwarden/server/blob/main/.claude/CONTRIBUTING.md?plain=1#L39

Comment thread .claude/CLAUDE.md Outdated
Comment thread .claude/CLAUDE.md Outdated
Comment thread .claude/CLAUDE.md
We maintain an SSDT project at `src/Sql/dbo/` (current state of the database) and hand-written dated migrations
under `util/Migrator/DbScripts/`. Every schema change updates both. Apply locally with `pwsh dev/migrate.ps1`.

See:
Copy link
Copy Markdown
Contributor

@theMickster theMickster May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Claude will likely never read these files the way that we have them listed here because it doesn't perform a WebFetch upon starting a coding session. Instead, I would encourage you to instruct Claude to create our first rules files based upon these contributing docs.
I think that these are direct, deterministic instructions that we can codify in those rules files. Then, we can reference them here or in other places with little nudges/hints (@SaintPatrck can give you some tips @Hinton where we did that in the iOS and android repos to nudge Claude). These Contributing Docs rarely, if ever, change so we don't need to worry about documentation drift at this point IMO.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should prompt a fetch when it want's to act on it though?

Copy link
Copy Markdown
Contributor

@theMickster theMickster May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's not going to happen the way that you assume it will happen. The file is a simple file based instruction file treated as plain text.
Claude code will never invoke a read of those URLs or any URLs embedded in our CLAUDE.md files. Any URLs should be used as reference materials for humans to improve a CLAUDE.md or similar file. Any information that Claude should leverage during a session needs to be inside .md files as plain text -or- you must create skills that leverage WebFetch or and MCP server to retrieve said data. The later is an expensive process which is why it's best practice to create supplemental example or reference files that Claude Code will progressively load as needed or directed by a human.

Comment thread .claude/CLAUDE.md Outdated
Co-authored-by: Mick Letofsky <mick.tosk@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants