3
votes

I have two Laravel projects. They are in different folders. It is okay until then.

Currently my projects use Laravel 5. The last one.

I have one project I tried to migrate. But, I do not have any idea why it is looking for migration files of another.

I run from /project1 to look for /project1/database/migrations by using this command:

php artisan migrate:refresh

However, it also looks for migrations of the project2 in the /project1/database/migrations like above:

enter image description here

Definitely it is not there. Because it doesn't belong to the /project1. Look at:

enter image description here

So, how does Laravel try to load migrations of any other project?

Ps.: I have already tried to clear the Laravel application cache. But, the bug persists.

2
Do the projects share the same database? Have you made a dump-autoload?sleepless
@watcher Yes, I did migrations on project1. But, they have nothing to do with the project2. So, I wouldn't need to move them.Seiji Manoan
@sleepless You pointed it! They use the same database. And I have noticed the Laravel depends on migrations database table. So, it has been shared between them. I cleared the migrations table and it works fine by now. Is it possible to change the migrations table name?Seiji Manoan

2 Answers

4
votes

As you stated your application is sharing the same database, so they share the same migrations table, just go to /config/database.php and rename it to the name you want:

/*
    |--------------------------------------------------------------------------
    | Migration Repository Table
    |--------------------------------------------------------------------------
    |
    | This table keeps track of all the migrations that have already run for
    | your application. Using this information, we can determine which of
    | the migrations on disk haven't actually been run in the database.
    |
    */

    'migrations' => 'migrations',
1
votes

As pointed in the comment you are using one database for two projects. The first answer pointed you on the rigt track how to rename the migrations table.

If you are sharing some tables with both projects however and each project still acts like it's own, you should take a look at this question (and the first answer) because this would be a better way to handle it:

Can I place two migration tables in different databases when using Laravel?