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

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

artesaos/migrator
=================

Namespaced Migrations for Laravel 5.1+

2.0.0(7y ago)4039.9k↓72.2%99MITPHP

Since Jun 2Pushed 6y ago7 watchersCompare

[ Source](https://github.com/artesaos/migrator)[ Packagist](https://packagist.org/packages/artesaos/migrator)[ RSS](/packages/artesaos-migrator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (14)Used By (9)

artesaos/migrator
=================

[](#artesaosmigrator)

[![Latest Stable Version](https://camo.githubusercontent.com/c93f29533806af060f0456aa6ba6f3173d489c981f269fa318bdbef2a95c2f69/68747470733a2f2f706f7365722e707567782e6f72672f6172746573616f732f6d69677261746f722f762f737461626c65)](https://packagist.org/packages/artesaos/migrator) [![Total Downloads](https://camo.githubusercontent.com/7959247f05c62659c1e04b28c3d03861c2ce4f2f72998ecc48edbde3c95f0118/68747470733a2f2f706f7365722e707567782e6f72672f6172746573616f732f6d69677261746f722f646f776e6c6f616473)](https://packagist.org/packages/artesaos/migrator) [![Monthly Downloads](https://camo.githubusercontent.com/66f650573b40ba43261001a993c6893c1e20b521591239baf980d97801988480/68747470733a2f2f706f7365722e707567782e6f72672f6172746573616f732f6d69677261746f722f642f6d6f6e74686c79)](https://packagist.org/packages/artesaos/migrator) [![License](https://camo.githubusercontent.com/c4ab1c34f2b53ba50d1bb89692e56551896aa9009ba98920136f7fe83e3935ff/68747470733a2f2f706f7365722e707567782e6f72672f6172746573616f732f6d69677261746f722f6c6963656e7365)](https://packagist.org/packages/artesaos/migrator)

This package is a customized version of Laravel's default database migrator, it was designed to register migrations on services providers and support namespacing as well.

There is no timestamp previews since the run order is based on how you register the migrations.

### Warning

[](#warning)

This Package Supports Laravel starting on 5.2 up to the latest stable version.

### Installing

[](#installing)

In order to install Migrator, run the following command into your Laravel 5.2+ project:

```
composer require artesaos/migrator

```

After installing the Package, you can now register it's provider into your config/app.php file:

```
'providers' => [
    // other providers omitted.
    Migrator\MigrationServiceProvider::class,
]
```

And publish configuration: with

```
php artisan vendor:publish --provider="Migrator\MigrationServiceProvider"

```

### Upgrading from v1.x to v2.0.

[](#upgrading-from-v1x-to-v20)

On v1.x, this package uses the same table name as the default migration engine.

On version v2, there is a separate table used for tracking migrations, and it defaults to: `migrator_table`

If you are upgrading from v1, you may either rename the `migrations` table to `migrator_table` **OR**publish the config file and set the migrator table name to `migrations`.

Either should work.

v2 works alongside default migrations, for projects who want to namespace migrations but already have many migrations in place.

### Usage

[](#usage)

As the default Laravel migrator, this one has all the original commands, to list the available options, you can see all the available options using `php artisan` command.

```
migrator            Run the database migrations
migrator:fresh      Drop all tables and re-run all migrations
migrator:install    Create the migration repository
migrator:make       Create a new migration file
migrator:refresh    Reset and re-run all migrations
migrator:reset      Rollback all database migrations
migrator:rollback   Rollback the last database migration
migrator:status     Show the status of each migration

```

#### Creating Migrations

[](#creating-migrations)

In order to generate an empty migration, please provide the migrator with the full qualified class name, as the example.

`php artisan migrator:make 'MyApp\MyModule\Database\Migrations\CreateOrdersTable' --create=orders`

This will create a migration class into the right directory, the resulting file is slightly different from the default Laravel generated:

```
