Mohamed Nizar
Mohamed Nizar

Reputation: 777

How to maintain two migration tables in Laravel Migration

I'm writing a custom migration and I need to maintain those migrations in a separate migration repository table. I override DatabaseMigrationRepository and replace the migration repository function as follows

public function registerRepository()
{

    $this->app->bindShared('migration.repository', function($app)
    {
        $table = $app['config']['database.cf_custom_migrations'];
        return new CustomDatabaseMigrationRepository($app['db'], $table);
    });
}

And I have registered my custom migration in artisan.php.

But when I call the custom migration command its execution is based on the Default Migration command.

Have anyone tried this before? How can run the Custom Migration command on Custom Migration table?

Upvotes: 2

Views: 293

Answers (1)

Exprator
Exprator

Reputation: 27513

create a custom command instead of using migrate which is default to laravel.

use that custom command to run your custom migrations.

hope it helps

Upvotes: 1

Related Questions