PHPackages                             pckg/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. pckg/migrator

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

pckg/migrator
=============

Database and config migrations made simple

34.2k1[1 issues](https://github.com/pckg/migrator/issues)PHPCI failing

Since Apr 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pckg/migrator)[ Packagist](https://packagist.org/packages/pckg/migrator)[ RSS](/packages/pckg-migrator/feed)WikiDiscussions next-8.0 Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Migrator
========

[](#migrator)

[![Codacy Badge](https://camo.githubusercontent.com/cb0b7b90e6cca2af2d52741a34cb036f87f1fa0084b392e8a44376c1e2ceeff3/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3739396263613938373237613439613238303762356136313334343061313963)](https://www.codacy.com/app/schtr4jh/migrator?utm_source=github.com&utm_medium=referral&utm_content=pckg/migrator&utm_campaign=badger)

[![Build status](https://github.com/pckg/migrator/workflows/Pckg%20Migrator%20CI/badge.svg)](https://github.com/pckg/migrator/workflows/Pckg%20Migrator%20CI/badge.svg)

Usage
=====

[](#usage)

Register `Pckg\Migration\Provider\Migration` provider in your application. This is only needed if you don't use `Pckg\Framework\Provider\Framework`.

```
...
use Pckg\Migration\Provider\Migration;
...
public function providers()
{
    return [
        Migration::class,
    ];
}

```

Consoles
--------

[](#consoles)

All commands are app-scoped and need to be prefixed with `php console $appName`.

`migrator:install` - Install migrations from environment

- `--only=SomeMigration` - Install only listed migrations
- `--fields` - Install only fields (no indexes/key)
- `--indexes` - Install only indexes/key (no fields)
- `--yes` - Say yes to all questions
- `--clear` - Clear cache before and after
- `--retry=1` - Retry iterations
- `--repository=default` - Install only repository

Create a migration
------------------

[](#create-a-migration)

```
