AgentSkillsCN

Backend Migrations

按照Laravel最佳实践创建数据库迁移,采用可逆的up/down方法、聚焦单一用途的更改、恰当的索引管理和清晰的命名规范。在创建新数据库表、添加或修改现有表的列、创建或删除索引、实现外键约束、重命名表或列、管理数据库模式变更时使用此技能。在database/migrations/目录的迁移文件上工作、通过artisan命令生成新迁移或确保零停机部署与向后兼容的模式变更时适用。

SKILL.md
--- frontmatter
name: Backend Migrations
description: Create database migrations following Laravel best practices with reversible up/down methods, focused single-purpose changes, proper index management, and clear naming conventions. Use this skill when creating new database tables, adding or modifying columns in existing tables, creating or dropping indexes, implementing foreign key constraints, renaming tables or columns, or managing database schema changes. This skill applies when working on migration files in database/migrations/ directory, generating new migrations via artisan commands, or ensuring zero-downtime deployments with backwards-compatible schema changes.

Backend Migrations

When to use this skill

  • When creating new database tables for models or features
  • When adding or modifying columns in existing tables
  • When creating or dropping database indexes for performance optimization
  • When implementing foreign key constraints for data integrity
  • When renaming tables or columns in the database schema
  • When managing database schema changes across environments
  • When working on migration files in database/migrations/ directory
  • When generating new migrations via php artisan make:migration commands
  • When ensuring zero-downtime deployments with backwards-compatible changes
  • When separating schema changes from data migrations
  • When implementing reversible migrations with proper down() methods

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle backend migrations.

Instructions

For details, refer to the information provided in this file: backend migrations