PHPackages                             lightscale/migrator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. lightscale/migrator

ActiveLibrary[Database &amp; ORM](/categories/database)

lightscale/migrator
===================

A generic database migration library

0.0.4(3y ago)021GPL-3.0-onlyPHPPHP &gt;=7.4

Since Oct 26Pushed 3y agoCompare

[ Source](https://github.com/lightscaletech/migrator)[ Packagist](https://packagist.org/packages/lightscale/migrator)[ RSS](/packages/lightscale-migrator/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

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
-------

[](#install)

This should be installed from packagist with composer:

```
$ composer require lightscale/migrator
```

Configuration
-------------

[](#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`.

```
$ cp vendor/lightscale/migrator/bin/migrator.php ./migrator
```

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:

```
