migration
Creates migration files for CatchAdmin. Standardizes field types and boilerplate for database schema changes.
Install
mkdir -p .claude/skills/migration && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6654" && unzip -o skill.zip -d .claude/skills/migration && rm skill.zipInstalls to .claude/skills/migration
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Generate database migration file for CatchAdmin module.Key capabilities
- →Generates migration files with standard CatchAdmin boilerplate
- →Maps standard field types like string, text, and integer to migration code
- →Configures unsignedInteger for timestamps and deleted_at fields
- →Adds index() calls to foreign key definitions
- →Implements down() method for schema reversal
How it works
It populates a pre-defined PHP template using a mapping table to convert user-defined types into specific migration methods.
Inputs & outputs
When to use migration
- →Create new database migration for CatchAdmin module
- →Define table schema using standard field types
- →Add indexes to migration files
About this skill
Step 2: Generate Migration
创建数据库迁移文件。
File Location
modules/{Module}/database/migrations/{timestamp}_create_{table}_table.php
Template
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('{table}', function (Blueprint $table) {
$table->id();
// Business fields (generated from definition)
// CatchAdmin standard fields
$table->unsignedInteger('creator_id')->default(0);
$table->unsignedInteger('created_at')->default(0);
$table->unsignedInteger('updated_at')->default(0);
$table->unsignedInteger('deleted_at')->default(0);
// Indexes
$table->index(['status', 'deleted_at']);
});
}
public function down(): void
{
Schema::dropIfExists('{table}');
}
};
Field Type Mapping
| Type | Migration Code |
|---|---|
| string(n) | $table->string('name', n) |
| text | $table->text('description')->nullable() |
| integer | $table->unsignedInteger('count')->default(0) |
| decimal(m,n) | $table->decimal('price', m, n) |
| tinyint | $table->tinyInteger('status')->default(1) |
| foreign_key | $table->unsignedBigInteger('category_id')->default(0)->index() |
| date | $table->date('birth_date')->nullable() |
| datetime | $table->dateTime('published_at')->nullable() |
| json | $table->json('options')->nullable() |
Important
- CatchAdmin 使用 unsigned integer 作为时间戳,不使用 Laravel 默认的
timestamps() - 软删除使用
deleted_atunsigned integer,不使用softDeletes() - 外键字段需要添加
index()
When not to use it
- →When working with standard Laravel migrations that require timestamps()
- →When using softDeletes() instead of custom deleted_at fields
Limitations
- →Hard-coded to use unsigned integers for all timestamps
- →Limited to the specific field types defined in the mapping table
How it compares
It enforces CatchAdmin-specific coding standards for database schema definitions, whereas standard migrations use generic Laravel defaults.
Compared to similar skills
migration side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| migration (this skill) | 1 | 6mo | No flags | Beginner |
| pennant-development | 2 | 4mo | No flags | Intermediate |
| extending-shopper | 1 | 4mo | No flags | Intermediate |
| controller | 1 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by JaguarJack
View all by JaguarJack →You might also like
pennant-development
laravel
Manages feature flags with Laravel Pennant. Activates when creating, checking, or toggling feature flags; showing or hiding features conditionally; implementing A/B testing; working with @feature directive; or when the user mentions feature flags, feature toggles, Pennant, conditional features, rollouts, or gradually enabling features.
extending-shopper
shopperlabs
Provides patterns for extending Laravel Shopper with custom sidebar items, component overrides, event listeners, and domain features like stock, pricing, and media. Use when customizing Shopper behavior.
controller
JaguarJack
Generate CRUD controller for CatchAdmin module.
filament-5-resources
kooda-ai
Use when: working with Filament 5 Resources, Resource classes, make:filament-resource, simple resources, form(), infolist(), table(), getPages(), resource pages, ViewRecord pages, page routes, ListRecords, CreateRecord, EditRecord, ViewRecord, relation managers, relation pages, getRelations(), getRe
lc:generate-table
edulazaro
Generate a table component with filters, sorting, infinite scroll using the project's TableComponent base.
php-best-practices
HoangNguyen0403
PHP best practices, PSR standards, and code quality guidelines.