一键导入
managing-migrations
Manages Entity Framework Core migrations using project scripts. Use when creating, applying, listing, or removing database migrations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manages Entity Framework Core migrations using project scripts. Use when creating, applying, listing, or removing database migrations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design system patterns for reusable UI via atomic design, Tailwind tokens/variants, and accessibility. Use when creating atoms/molecules, theming, or hardening a11y.
Entity Framework Core best practices for configuration, queries, concurrency, and multi-tenancy.
Frontend architecture patterns for React apps (React Router 7, TanStack Query). Use when planning features, defining routes, data strategies, and component gaps.
Infrastructure standards for Docker, scripts, middleware, and authentication in multi-tenant deployments.
Integration testing performance optimization, test parallelization, cleanup strategies, and CI/CD categorization patterns. Use when optimizing test execution speed, managing test data, or structuring tests for automated pipelines.
ASP.NET Core Minimal APIs patterns for endpoints, DTOs, validation, and service integration. Use when implementing API endpoints, defining request/response contracts, or structuring API projects with clean separation of concerns.
| name | managing-migrations |
| description | Manages Entity Framework Core migrations using project scripts. Use when creating, applying, listing, or removing database migrations. |
This project provides standardized scripts for all EF Core migration operations. Always use these scripts instead of running dotnet ef commands directly. The scripts ensure consistent project paths, output directories, and connection strings across all environments.
Located in scripts/bash/:
db-migrate-add.sh - Create a new migrationdb-migrate-list.sh - List all migrations and their statusdb-migrate-remove.sh - Remove the last migration (if not applied)db-update.sh - Apply all pending migrations to the databasedb-reset.sh - Drop and recreate the database with all migrationsLocated in scripts/powershell/:
db-migrate-add.ps1 - Create a new migrationdb-migrate-list.ps1 - List all migrations and their statusdb-migrate-remove.ps1 - Remove the last migration (if not applied)db-update.ps1 - Apply all pending migrations to the databasedb-reset.ps1 - Drop and recreate the database with all migrationsAfter modifying entity configurations or adding new entities:
Bash:
./scripts/bash/db-migrate-add.sh AddShowEntity
PowerShell:
./scripts/powershell/db-migrate-add.ps1 -MigrationName AddShowEntity
Migration Naming Conventions:
Add, Update, Remove, RenameAddShowEntity, UpdateVenueAddressFields, RemoveObsoleteColumnsAfter creating a migration or pulling new migrations from source control:
Bash:
./scripts/bash/db-update.sh
PowerShell:
./scripts/powershell/db-update.ps1
To see which migrations exist and which have been applied:
Bash:
./scripts/bash/db-migrate-list.sh
PowerShell:
./scripts/powershell/db-migrate-list.ps1
If you created a migration by mistake and haven't applied it yet:
Bash:
./scripts/bash/db-migrate-remove.sh
PowerShell:
./scripts/powershell/db-migrate-remove.ps1
Important: This only works if the migration hasn't been applied to any database. If it has been applied, you need to create a new migration to revert the changes.
To drop and recreate the database with all migrations (useful for development):
Bash:
./scripts/bash/db-reset.sh
PowerShell:
./scripts/powershell/db-reset.ps1
Warning: This destroys all data in the database. Only use in development environments.
When implementing persistence layer changes:
src/GloboTicket.Infrastructure/Data/Configurations/db-migrate-add.sh or db-migrate-add.ps1src/GloboTicket.Infrastructure/Data/Migrations/db-update.sh or db-update.ps1The scripts are pre-configured with:
src/GloboTicket.Infrastructuresrc/GloboTicket.APIData/MigrationsServer=localhost,1433;Database=GloboTicket;User Id=migration_user;Password=Migration@Pass123;TrustServerCertificate=True;Encrypt=TrueYou should never need to specify these manually when using the scripts.
dotnet ef command syntax./scripts/bash/docker-up.sh./scripts/bash/docker-status.sh