Specifications:
Here are the steps I took to solve the same issue:
In the console I wrote php artisan tinker
Then, again in the console, Schema::drop('users')
At the end php artisan migrate
and it all worked.
Create your migrations by command php artisan make:migration create_category_table Then in your database/migrations set your necessary fields and databases,then run this command pho artisan migrate --pretend It will show sql statements,copy sql statement of category and paste it in database in sql and just click on run,your migrations would be there,no need to delete users table
The simple way to solve this problem is run the following command
php artisan migrate:fresh
Following command solved my problem:
1. php artisan tinker
2. Schema::drop('your_table_name')
3. php artisan migrate
Migration errors usually occur when using php artisan migrate
and your migration has an error.
Within Laravel, there are some ways to reverse something that has been performed, especially migrations to more robust databases like MySql, for example.
One way to be reversing the step taken
php artisan migrate
is to run the
php artisan migrate: rollback
It automatically reverses the last migrate performed You also have the possibility to delegate how many steps will be reversed with the step parameter.
The number says how many steps will be reversed
php artisan migrate: rollback --step=1
Here are the steps I took to solve the same issue:
php artisan make:migration create_tableName_table --create=tableName.
php artisan migrate.
appear error,you can drop all file in migration and all table in database.
create new table as 1.
finish. okay.