dotnet-add-ef-migration

Automates EF Core migration generation by auto-detecting the relevant .NET project and DbContext.

8|1|Updated Feb 5, 2018
One-click install
npx skills add https://github.com/umbrella-libraries/Umbrella --skill dotnet-add-ef-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-add-ef-migration
Source: https://github.com/umbrella-libraries/Umbrella/tree/main/.agents/skills/dotnet-add-ef-migration
Command: npx skills add https://github.com/umbrella-libraries/Umbrella --skill dotnet-add-ef-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Add EF Core migrations with auto-detection of the migrations project, startup project, and DbContext, eliminating manual project guessing and reducing errors.

Core Features & Use Cases

  • Auto-detects the migrations project, startup project, and DbContext to generate a migration without explicit paths.
  • Reports new and modified files and warns on empty migrations to prevent accidental commits.
  • Supports both automatic detection and explicit project/context specification for flexible usage.

Quick Start

Run the Invoke-AddEfMigration.ps1 script with a MigrationName to create a new EF Core migration using auto-detection and safety checks.

Frequently Asked Questions about dotnet-add-ef-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add EF Core migrations in a multi-project .NET solution without manually specifying project paths?

You can add EF Core migrations using auto-detection to automatically identify the migrations project, startup project, and DbContext. This eliminates manual project guessing and reduces errors in multi-project solutions by generating migrations without explicit paths.

How does auto-detection for EF Core migrations work?

Auto-detection for EF Core migrations works by scanning your .NET solution to identify the migrations project, startup project, and DbContext automatically. It then generates the migration and applies safety checks, including non-empty migration validation and verbose reporting.

Can I explicitly specify the DbContext and project paths instead of using auto-detection?

Yes, you can explicitly specify the project and DbContext instead of relying on auto-detection. The script supports both automatic detection and explicit project/context specification, providing flexible usage depending on your solution structure.

How do I prevent committing empty EF Core migrations?

To prevent committing empty EF Core migrations, the script warns you when it detects an empty migration. It also reports all new and modified files generated during the process, ensuring you have full visibility before committing changes.

What's the best way to automate EF Core migration creation with PowerShell?

The best way to automate EF Core migration creation is running a PowerShell script that auto-detects the migrations project, startup project, and DbContext. It applies non-empty migration validation and provides verbose reporting of new and modified files.

Does this EF Core migration automation work with multi-project .NET solutions?

Yes, this EF Core migration automation is specifically designed for multi-project .NET solutions. It automatically detects the correct migrations project, startup project, and DbContext, allowing you to generate migrations without manually navigating complex project structures.