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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With