database-migrations
Skill1 starsChanged 6 days agoMITView on GitHub
How to change the data model and add an EF Core migration for the SQLite database, including the namespace, folder and naming fixes the tools need. Use when adding a column, table, index or relationship.
52 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
- profdorly/ultimate-dev-skillstheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- reddygopalkrishna/developer-agent-skillstheir own version, first seen Nov 8, 2026
- Lukk17/agent-standardstheir own version, first seen Nov 7, 2026
Used with
Projects with it also use deployment-patterns, postgres-patterns and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
royaluniondesign-sysSkilldeployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.
Also in 6 projects that use this
nek1987Skillpostgres-patterns
PostgreSQL patterns for reviewing migrations and writing efficient queries. Use when reviewing Alembic migrations, optimizing queries, or debugging database issues.
Also in 7 projects that use this
nek1987Skillredis-patterns
Upstash Redis patterns for caching and rate limiting.
Also in 3 projects that use this
HABUBUSSSkillbackend-patterns
Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.
Also in 9 projects that use this
seikaikyoSkillfastapi-patterns
FastAPI + SQLModel + Neon PostgreSQL 後端開發最佳實踐。適用於 Render 部署的 API 服務。涵蓋路由設計、資料庫操作、錯誤處理、認證授權。
Also in 3 projects that use this
SentrySkillreact-testing
Write and review React/TypeScript tests for Sentry's frontend using Jest and React Testing Library. Use when adding or editing tests in static/ (*.spec.tsx), writing component/hook tests, mocking API responses with MockApiClient, testing routing or network requests, or when asked to "write a frontend test", "add a React test", "test this component", or "fix a flaky RTL test".
Also in 3 projects that use this
Other versions52 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 52
- loulanyue/awesome-claude-notes★ 272same name
- langchain-ai/skills-benchmarks★ 116same name
- Fmarzochi/EGC★ 61same name
- skateddu/claude-code-python-setup★ 28same name
- wpank/ai★ 11same name
- gongyijie85/dsh-ecc★ 8same name
- reddygopalkrishna/developer-agent-skills★ 8same name
- zero-click/zero-ratchet★ 8same name
- sponge-b0b/Polaris★ 4same name
- chadixearth/graphyloop★ 3same name
42 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-a-use-caseSkill
- api-conventionsSkill
- branches-and-pull-requestsSkill
- cancellationSkill
- ci-for-your-solutionSkill
- ci-pipelineSkill
- clean-architecture-layersSkill
- configuration-and-environmentsSkill
- coverageSkill
- csharp-house-styleSkill
- data-access-ef-coreSkill
- docker-and-composeSkill
- docs-and-voiceSkill
- errors-and-exceptionsSkill
- expose-a-use-caseSkill
- family-syncSkill
- health-checksSkill
- integration-testsSkill
- json-serializationSkill
- mapping-with-mapperlySkill
- mcp-inspectorSkill
- mediatorSkill
- optional-token-authSkill
- packages-and-dependenciesSkill
- pagingSkill
- presentation-integration-testsSkill
- releasesSkill
- sample-dataSkill
- security-findingsSkill
- serilogSkill
- telemetrySkill
- template-authoringSkill
- test-designSkill
- time-providerSkill
- unit-testsSkill
- validationSkill
- writing-a-skillSkill
- xml-docs-and-openapiSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 1 is distinctive, and 6 are very specific to this project.
0
Common
Most of the 48 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Add the migration from the repository root:
- Very specific: line 27
Check where the files landed.
- Very specific: line 37
Update MovieReviewsDbContextExtensions.AddData and the test data if the new column needs a value (sample-data).
- Very specific: line 38
Check nothing is left over with dotnet ef migrations has-pending-model-changes --project ./src/Infrastructure, then run every test project.
- Very specific: line 43
Call EnsureCreated() anywhere.
- Very specific: line 44
Use ValueGeneratedOnAdd() on DateCreated or DateModified.
- Very specific: line 45
Add data annotations like [Required] or [MaxLength] to models.
“Common” is measured: kept by at least 6 in 10 of the 48 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database migrations
The rule
The schema comes only from migrations in src/Infrastructure/Databases/MovieReviews/Migrations. The app applies pending migrations at startup in InitialiseInfrastructure(), and the tests build their databases from the same migrations, so a model change without a migration fails the tests. MovieReviewsDbContextFactory lets the EF Core tools create the context at design time.
Steps
- Change the database model in
Models/and its configuration inConfiguration/. Relationships, keys, indexes and collations are configured with the fluent API in anEntityConfiguration<T>subclass. Text people search or sort by usesUseCollation(Collations.NoCase), and columns we sort or filter by get aHasIndex. - Install the tool once:
dotnet tool install --global dotnet-ef. Add the migration from the repository root:
dotnet ef migrations add <Name> \ --project ./src/Infrastructure \ --output-dir Databases/MovieReviews/Migrations \ --namespace CleanModelContextProtocol.Infrastructure.Databases.MovieReviews.Migrations- Check where the files landed. If
MovieReviewsDbContextModelSnapshot.cswas written somewhere else or in another namespace, move it intoMigrations/and fix its namespace. Strip the byte order mark the tool adds, so
dotnet formatand the diff stay clean, and make sure the migration file starts with// <auto-generated />so the analysers skip it. The tool adds that line to the.Designer.csfile but not always to the migration itself:sed -i '1s/^\xEF\xBB\xBF//' src/Infrastructure/Databases/MovieReviews/Migrations/*.cs- Rename both files and the
[Migration]attribute to<yyyyMMdd>000000_<Name>, so the id is the day it was written and not the second you ran the tool. - Name the migration for what it does (
AddReviewComment), in PascalCase. - Update
MovieReviewsDbContextExtensions.AddDataand the test data if the new column needs a value (sample-data). - Check nothing is left over with
dotnet ef migrations has-pending-model-changes --project ./src/Infrastructure, then run every test project. Migrations are excluded from coverage.
Don't
- Edit a migration that has already been released. Add a new one.
- Call
EnsureCreated()anywhere. It skips migrations. - Use
ValueGeneratedOnAdd()onDateCreatedorDateModified. SQLite then tries to insert NULL into a NOT NULL column; the repository sets both. - Add data annotations like
[Required]or[MaxLength]to models. Configure inConfiguration/.
Check
dotnet build
dotnet test
dotnet format --verify-no-changesDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

