What problem does it solve?
Managing PocketBase schema changes across development, staging, and production environments is error-prone when done manually through the Dashboard. This Skill provides the commands, file formats, and patterns needed to version-control schema changes, sync collections between environments, and roll back failed migrations safely.
Core Features & Use Cases
- Migration CLI Workflows: Create, apply, revert, and snapshot migrations using
migrate create, migrate up, migrate down, migrate collections, and history-sync.
- Programmatic Collection Definitions: Write migration files that define base, auth, and view collections with fields, indexes, API rules, and auth settings in JavaScript.
- Environment Sync & Seeding: Use auto-migrate in development, disable it in production with
--automigrate=0, snapshot schemas with importCollections, and seed superusers or settings via migrations and onBootstrap.
- Use Case: You designed collections in the Dashboard during development and now need to deploy to production. Commit the auto-generated
pb_migrations/ files, deploy with auto-migrate disabled, and migrations run automatically on server start.
Quick Start
Ask the assistant to create a PocketBase migration that adds a posts collection with title, body, and author relation fields including a reversible down migration.