2

I can't make it work to use migrations on my laravel installation (Windows 8.1 host). I make 2 migrations via:

php artisan migrate:make create_language_table

The file was created under app/database/migrations. I use the Schema Creator to create a new table (database connection already working by the way). When i try to run the migrations with:

php artisan migrate

Laravel says "Nothing to migrate." Beside this there's always the question if I really want to run this command (Application in production). The path showing up for the migrations is

C:\MAMP\htdocs\example\app/database/migrations/*_*.php

Could this be a path problem on Windows (mixing slashes with backslashes)? Thank in advance for all responses!

G-Wak
  • 53
  • 3
  • 12
  • Have you cleared your 'migrations' table in your local database? Laravel uses these to know which migrations it's ran. If you've ran an empty database schema, it'll still insert the name of the migration into the migrations table inside the database, therefore preventing you from running it again since laravel thinks it's already been ran. – Steve Bauman Mar 21 '15 at 20:19
  • I've also tried already to drop the migrations table and remove all migrations files from the folder. Then run "php artisan migrate:install" to get a clean migrations table in the database (successfull). Then I tried to create and migrate this file once more - still the same message. – G-Wak Mar 21 '15 at 20:22
  • Hmm, odd. After generating a new migration, try doing a `composer dump-autoload` and a `php artisan dump-autoload` then try migrating again. – Steve Bauman Mar 21 '15 at 20:28
  • Tried this already but just to be sure, tried another time yet. Still the same message. – G-Wak Mar 21 '15 at 20:35
  • Ok, you could try generating a new laravel project and try migrating to test to see if it's your environment or if it's unique to your project? – Steve Bauman Mar 21 '15 at 20:38
  • Tried it with a total new project (by the way, I'm using laravel 4.2.17). Same message. Seems to be an environment problem. – G-Wak Mar 21 '15 at 21:18
  • Try running php artisan clear-compiled. If still no joy, delete all the contents of, storage/migrations and storage/cache. – verheesj Mar 21 '15 at 22:29

2 Answers2

1

I have had a similar issue in the past on Windows 7. I was able to get around the problem by sending the path to the migrations:

php artisan migrate --path=app/migrations

Hope this works for you.

verheesj
  • 1,438
  • 2
  • 16
  • 24
  • Also tried this, but still get the same message. Although I had no special chars in my path, I tried to move my migration file to "C:/migrations" and call "php artisan migrate --path=../../migrations", still the same... I don't know what to do anymore, so far the only option for me is to switch to my Mac (on which it is working without any problems). – G-Wak Mar 22 '15 at 09:20
  • `php artisan make:migration --path=database/migrations` worked for me on windows 7. – Saw-mon and Natalie May 29 '18 at 06:31
0

If it says Nothing to migrate that indicates there are no new migrations to be run. If you want to re-run the migration (which are already migrated), you can run:

php artisan migrate:refresh

This command will rollback everything (including Tables and its data) and re-run them.

To make sure if you have any pending migrations you can run:

php artisan migrate:status

this will show you the migration with their status(whether it is migrated or not )

Alternatively you try

php artisan migrate:reset

this command. this will reset all the migrations and you can start fresh.

Ram Chander
  • 1,088
  • 2
  • 18
  • 36