Question

i have created my database , then i have created a table with

php artisan migrate: make create_users_table 

a file has created so i modified up and down function and i typed

php artisan migrate 

until now everything is ok the problem started when i tried to add another lignes to my database , i added another information about users and when i type

php artisan migrate

the response was Nothing to migrate and there is no change into my databse ?

Was it helpful?

Solution

3 possibilities:

  1. Create a new migration

  2. Rollback the last migration operation and rerun it :

    php artisan migrate:rollback
    php artisan migrate 
    
  3. Rollback all migrations and run them all again

    php artisan migrate:refresh
    

More info here: http://laravel.com/docs/migrations

OTHER TIPS

You have to create another migration, or you can refresh your previous migrations

php artisan migrate:refresh

http://laravel.com/docs/migrations

If you just added more records in a table that already exists using e.g. phpmyadmin, there is no need to run again php artisan migrate, because no extra migration is created. That's why you get the "Nothing to migrate" message.

But, if you want for example to add a new column or delete an existing one, the ideal way to do it is by creating a new migration and name it something like add_columnname_on_users_table, edit properly the new migration file, then run php artisan migrate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top