Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel's Artisan says nothing to migrate

I installed migrations with php artisan migrate:install then created a migration with the php artisan migrate:make create_teams_table command. Now I try to run them with the following command that I made according to the official documentation:

php artisan migrate --path=app/foo/migrations/2014_01_21_143531_create_teams_table.php 

This gives me the following on the console:

Nothing to migrate.

The migrations table in the database is empty and the new table isn't created neither. I don't understand why the documentation says foo in the path. What does foo mean and where does it comes from? First I tought that the path is wrong because of the foo thing and as I know the path is relative to the app folder so I changed it to app/database/migrations but it doesn't work. I also tried a lot of other path combination but none of them worked.

Did I entered the wrong path? In this case shouldn't the console show some other kind of helpfull message? What does foo mean? How can I run my migration?

like image 344
totymedli Avatar asked Jan 21 '14 19:01

totymedli


People also ask

How do I create an artisan migration?

To create a new migration, you can run the make:migration Artisan command and that will bootstrap a new class on your Laravel application, in the database/migrations folder. This class will contain a default boilerplate code.

What does artisan migrate -- force do?

php artisan migrate --force publishes schema to the database, even in production. migrate --force ensures that the migrations are published even when the application is in product mode.


2 Answers

Try this:

First:

php artisan migrate:reset 

Rolled back: 2014_03_28_142140_user_table

Nothing to rollback.

second:

php artisan migrate 

Migrated: 2014_03_28_142140_user_table

check the database.

like image 51
user3474053 Avatar answered Sep 28 '22 12:09

user3474053


That foo thing is just an example. Laravel will look for migrations to run in app/database/migrations on default. Try removing that --path parameter and see if it works.

like image 26
AntonNiklasson Avatar answered Sep 28 '22 11:09

AntonNiklasson