kba-team / phinx-cake2
Easy usage of Phinx with CakePHP2
Installs: 7 742
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:tools
Requires
- php: >=7.4 <8.4
- ext-json: *
- cakephp/cakephp: ^2.4
- robmorgan/phinx: ^0.12.9
Requires (Dev)
- phpstan/phpstan: ^1.10
This package is auto-updated.
Last update: 2024-12-08 16:03:49 UTC
README
Phinx is the default tool for database migrations in CakePHP3 and CakePHP4. Phinx can be used as a standalone tool, so it is possible to use it with CakePHP2. This project makes usage of Phinx with CakePHP2 less complicated.
Prerequisites
- PHP >= 7.0
- CakePHP2 installed via composer
- Mysql (no other DB supported a the moment)
- Migrations in folder Config/Migrations
- Seeds in folder Config/Seeds
What does it do?
This package provides a helper script and a default Phinx config file for usage with you CakePHP2 project.
By using the helper script it is not necessary to create a Phinx configuration for your project.
Installation
composer require kba-team/phinx-cake2
Usage
Usage: phinx-cake2.sh [command] [arguments] [options]
Example
./vendor/bin/phinx-cake2.sh migrate
If you want to migrate a plugin's migration.
PLUGIN=<plugin_name> ./vendor/bin/phinx-cake2.sh migrate
In case the plugin uses its own database, you need to set the following in a file called phinx.php
in the plugin's Config directory.
Configure::write('phinx.datasource', "<datasource name>");