kriptonic / php-database-migration
PHP Migrations Made Easy
Requires
- php: >=5.3.0
- ext-json: *
- ext-pdo: *
- cocur/slugify: ~1.0
- symfony/config: ~2.6|~3.0
- symfony/console: ~2.6|~3.0
- symfony/process: ~2.6|~3.0
- symfony/yaml: ~2.6|~3.0
Requires (Dev)
- dev-master
- v4.0.0
- v3.8.0
- v3.7.1
- v3.7.0
- v3.6.10
- v3.6.9
- v3.6.8
- v3.6.7
- v3.6.6
- v3.6.5
- v3.6.4
- v3.6.3
- v3.6.2
- v3.6.1
- v3.6.0
- v3.5.4
- v3.5.3
- v3.5.2
- v3.5.1
- v3.5.0
- v3.4.4
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.0
- v3.0.0
- 2.2.1
- 2.2.0
- 2.1.2
- 2.1.0
- 2.0.0
- 1.0.0
- dev-pre-release-v4.0.0
- dev-dev
- dev-dev-migration-statuses
- dev-elgaard-master
- dev-feature-support-symfony-console-4.x
- dev-chxj1992-db_charset_feature
- dev-feature-integration
- dev-feature-projectpage
- dev-stable
- dev-symfony-console
This package is not auto-updated.
Last update: 2025-04-11 01:49:32 UTC
README
I liked the simplicity of the php-database-migration
tool created by alwex
.
I have forked the repository to add configuration changes that make
integration into existing products easier, as well as providing more
flexibility to developers.
Planned Features
I am currently focusing on the following features:
User defined directoriesSupport for multiple databases with separate migrations- Better handling of remote migrations without local
Getting Started
This section will be added to once the vision for the package is more complete.
Installation
todo
Note: The package has not been added to packagist so you aren't able to install via Composer yet.
Configuration
The package will store user environment configuration and migrations in the
php_db_migration
folder relative to where the application is ran from.
If you wish to change directories used by the package create a new PHP file
where you want to run the application from. Place the following into the file:
#!/usr/bin/php <?php require 'vendor/autoload.php'; $config = array( 'working_path' => __DIR__ . '/custom_dir', 'migration_path' => __DIR__ . '/custom_dir/migrations', 'environment_path' => __DIR__ . '/custom_dir/environments' ); $app = new Migrate\Manager($config); // Add custom commands here. // $app->add(new MyCustomCommand()); $app->run();
Adjust the working_path
, migration_path
, and environment_path
fields to
suit your requirements. If you leave the environment_path
and migration_path
empty then environments
and migrations
will be used respectively as defaults
within the working_path
directory.
Simple Usage
Run the program on the commandline from the project root php bin/migrate
or the custom runner you created if you changed the paths.