- Add 60 new agents across all 10 categories (75 -> 135) - Add 95 new plugins with command files (25 -> 120) - Update all agents to use model: opus - Update README with complete plugin/agent tables - Update marketplace.json with all 120 plugins
1.4 KiB
1.4 KiB
/create-migration - Create Database Migration
Generate a database migration file for schema changes.
Steps
- Ask the user for the migration description (e.g., "add users table", "add email index")
- Detect the database and migration tool: Prisma, Knex, TypeORM, Alembic, Django, Rails
- Analyze the requested schema change: new table, alter column, add index, etc.
- Generate the up migration with the schema change SQL or ORM commands
- Generate the corresponding down migration to reverse the change
- Add proper column types, constraints, defaults, and nullability
- Include index creation for foreign keys and frequently queried columns
- Add data migration logic if the schema change requires data transformation
- Validate the migration SQL syntax for the target database engine
- Name the migration file with timestamp prefix and descriptive slug
- Save the migration to the correct migrations directory
- Report the created migration path and provide a preview of the SQL
Rules
- Always include both up and down migration logic
- Use the ORM's migration generator when available instead of raw SQL
- Add NOT NULL constraints with DEFAULT values to avoid breaking existing rows
- Create indexes for all foreign key columns
- Use transactional migrations when the database supports DDL transactions
- Test the migration against a local development database before committing
- Include a comment explaining the purpose of the migration