From f5-core
Manages database operations including schema viewing, migrations, seeding, model generation, and ER diagrams for auto-detected project stack. Supports schema, migrate, seed, model, diagram subcommands.
How this command is triggered — by the user, by Claude, or both
Slash command
/f5-core:f5-db <migrate|seed|schema> [action]The summary Claude sees in its command listing — used to decide when to auto-load this command
# /f5-db - Database Management Assistant Hỗ trợ quản lý database theo stack đã chọn trong project. ## ARGUMENTS The user's request is: $ARGUMENTS ## DETECT DATABASE STACK ## COMMANDS | Command | Description | |---------|-------------| | `schema` | View current database schema | | `migrate` | Run pending migrations | | `migrate create <name>` | Create new migration | | `migrate rollback` | Rollback last migration | | `seed` | Run database seeders | | `seed create <name>` | Create new seeder | | `reset` | Reset database (migrate + seed) | | `model <name>` | Generate model/entity | | `d...
Hỗ trợ quản lý database theo stack đã chọn trong project.
The user's request is: $ARGUMENTS
# Auto-detect from .f5/config.json
DB=$(jq -r '.stack.database // "postgresql"' .f5/config.json 2>/dev/null)
BACKEND=$(jq -r '.stack.backend // "nestjs"' .f5/config.json 2>/dev/null)
| Command | Description |
|---|---|
schema | View current database schema |
migrate | Run pending migrations |
migrate create <name> | Create new migration |
migrate rollback | Rollback last migration |
seed | Run database seeders |
seed create <name> | Create new seeder |
reset | Reset database (migrate + seed) |
model <name> | Generate model/entity |
diagram | Generate ER diagram |
| Backend | Database | ORM/Client |
|---|---|---|
| NestJS | PostgreSQL | Prisma |
| NestJS | MySQL | TypeORM |
| FastAPI | PostgreSQL | SQLAlchemy |
| Django | PostgreSQL | Django ORM |
| Spring | PostgreSQL | JPA/Hibernate |
| Go | PostgreSQL | GORM |
| Laravel | MySQL | Eloquent |
| Rails | PostgreSQL | ActiveRecord |
| .NET | SQL Server | Entity Framework |
| Rust | PostgreSQL | Diesel |
# View schema
/f5-db schema
# Generate schema diagram
/f5-db diagram
Output:
## Database Schema: {{DB_NAME}}
### Tables:
{{table list with columns}}
### Relationships:
{{ER diagram in mermaid}}
# Create migration
/f5-db migrate create add_users_table
# Run migrations
/f5-db migrate
# Rollback
/f5-db migrate rollback
# Generate model from table
/f5-db model User
# Generate with relations
/f5-db model Order --relations
/f5-db prisma generate # Generate client
/f5-db prisma studio # Open Prisma Studio
/f5-db prisma format # Format schema
/f5-db alembic revision # Create revision
/f5-db alembic upgrade # Apply migrations
/f5-db alembic downgrade # Rollback
/f5-db makemigrations # Create migrations
/f5-db migrate # Apply migrations
/f5-db shell # Database shell
/f5-db typeorm migration:create
/f5-db typeorm migration:run
/f5-db typeorm migration:revert
/f5-db artisan migrate
/f5-db artisan migrate:rollback
/f5-db artisan db:seed
# Schema operations
/f5-db schema
/f5-db diagram
# Migrations
/f5-db migrate create create_orders_table
/f5-db migrate
/f5-db migrate rollback
# Models
/f5-db model User
/f5-db model Product --relations
# Seeding
/f5-db seed create UserSeeder
/f5-db seed
# Reset for development
/f5-db reset
/f5-db mongo schema # View collections
/f5-db mongo index <col> # Create indexes
/f5-db mongo model <name> # Generate Mongoose model
/f5-db redis keys # List keys
/f5-db redis flush # Flush database
/f5-db redis info # Show info
Claude automatically applies:
Naming Conventions
Common Patterns
Performance
Security
npx claudepluginhub fujigo-software/f5-framework-claude --plugin f5-core/fire-migrate-databaseGuides database migration between PostgreSQL, MySQL, SQLite, and SQL Server through a structured 6-step pipeline: assess, plan, execute, verify.
/prisma-schema-genGenerates complete Prisma schema.prisma from natural language descriptions of models and relationships. Includes indexes, validators, and optional database provider like PostgreSQL.
/schema-generatorGenerates optimized database schemas and automated migration scripts for PostgreSQL, MySQL, MongoDB with ORM integration for Prisma, TypeORM, Sequelize, and Mongoose.
/design-schemaDesign database schema for new feature with normalization and constraints.
/designDesigns database schema for a feature from requirements, generates ERD diagram, SQL tables with indexes, migration files, and optional seed data.
/migrationGenerates timestamped up/down migration files for PostgreSQL, MySQL, SQLite, MongoDB using SQL or ORM, with run instructions and testing guidance.