A VSCode extension to streamline the use of Phinx in CakePHP, allowing you to create, execute, and rollback migrations directly from the editor.
- 📝 Create Migration - Create new migrations with name validation
- ⬆️ Migrate - Execute all pending migrations
- ⬇️ Rollback - Revert the last executed migration
- 🐳 Docker Support - Compatible with
docker-composeanddocker exec - 🎯 Auto-open - Automatically opens the created migration file
- ⚙️ Configurable - Per-project customization
- VSCode 1.60.0 or higher
- Project with Phinx installed via Composer
composer_modules/bin/phinxavailable in project root
Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) and type "Phinx:" to see available commands:
- Opens a dialog to enter the migration name
- Creates the migration in
db/migrations/ - Automatically opens the created file
- Executes all pending migrations
- Asks for confirmation before running
- Reverts the last migration
- Asks for confirmation before running
{
"phinx.useDocker": false,
"phinx.phinxPath": "composer_modules/bin/phinx"
}{
"phinx.useDocker": true,
"phinx.dockerMethod": "docker-compose",
"phinx.dockerComposeService": "php-fpm",
"phinx.phinxPath": "composer_modules/bin/phinx"
}{
"phinx.useDocker": true,
"phinx.dockerMethod": "docker",
"phinx.dockerComposeService": "php-fpm",
"phinx.phinxPath": "composer_modules/bin/phinx"
}| Option | Type | Default | Description |
|---|---|---|---|
phinx.useDocker |
boolean | false |
Execute commands inside Docker |
phinx.dockerMethod |
string | docker-compose |
Method: docker-compose or docker |
phinx.dockerContainer |
string | php-fpm |
Docker container name |
phinx.dockerComposeService |
string | php-fpm |
Service name in docker-compose.yml |
phinx.phinxPath |
string | composer_modules/bin/phinx |
Path to phinx |
phinx.workingDirectory |
string | /app |
Working directory in container |
- Make sure to open your project in VSCode as a folder (
File→Open Folder)
- Verify Phinx is installed:
ls composer_modules/bin/phinx - Update the
phinx.phinxPathsetting in.vscode/settings.json
- Verify volumes are correctly configured in
docker-compose.yml - The project should be mounted at
/app(or adjustphinx.workingDirectory)
- Verify that the
db/migrations/folder exists - Open Developer Console (
Ctrl+Shift+I) to check debug logs
MIT
Contributions are welcome. Please open an issue or pull request.