Download the PHP package lightscale/migrator without Composer
On this page you can find all versions of the php package lightscale/migrator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lightscale/migrator
More information about lightscale/migrator
Files in lightscale/migrator
Package migrator
Short Description A generic database migration library
License GPL-3.0-only
Informations about the package migrator
Migrator
A simple php database migrations library and management tool. This is standalone database migration library that is usable in any platform with any database.
Its in very early development but usable. You need to know what your doing to use this.
Install
This should be installed from packagist with composer:
Configuration
You need to do two things to use this. Copy the command line tool that manages
migrations to the root of your project. It needs to be the same directory as
/vendor
.
You then need a config file. This is where things get tricky as in here you to give migrator callback functions to get the current migration version and set it. You also need to create a function that provides what over database object you need to be able to modify your database.
Here is a very basic template:
Of course you might want to stick it in a class or namespace to avoid name collisions. Just make sure that the config file returns an associative array that contains the required properties.
Check out lightscale/migrator-config-wordpress for a working example.
Usage
Run the ./migrator
script. This will output the help.
Here is the available commands:
Migrations
Here is the file structure of the migrations. You can specify the directory in the config and then its just flat:
This is the structure of a migration:
Release history
- 0.0.2
- Feature - ability to set a class to extend migrations with.
- Bug - update version to last successful when a migration fails.
- Bug - fixes to migrator_dir handling so it can find migrations.
- 0.0.1 All core functionality working. Still in on-going development.
Requirements
- PHP 7.1.3
- Composer
Contributors
Sam Light
Licence
This project is licensed under the GPLv3 License - see the LICENSE file for details.