Back

drop table Password reset


hi i drop manual table password reset and after this i want to run php artisan migrate:rollback throw below error to me :


 [Illuminate\Database\QueryException]
 SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'laravel5.password_resets' (SQL: drop table `password_resets`)






 [PDOException]
 SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'laravel5.password_resets'

What do I do?

omidnikrah replied 2 years ago

i too drop table user and i want to run php artisan migrate:reset throw below error :


  [Illuminate\Database\QueryException]
  SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'laravel5.users' (SQL: drop table `users`)






  [PDOException]
  SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'laravel5.users'


shez1983 replied 2 years ago

you have few options:

  1. if you have all your tables in migration folder & you are not yet in production mode, delete the database and run migrate again

  2. you could modify the migration table and remove reference to password_reset table

omidnikrah replied 2 years ago Solution

i can create user migration but can't create password_resets migration i delete migration table and after that run php artisan migrate but throw below error :



  [Illuminate\Database\QueryException]
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel5.password_resets' doesn't exist (SQL: alter table `password_resets` add `email
  ` varchar(255) not null, add `token` varchar(255) not null, add `created_at` timestamp default 0 not null)






  [PDOException]
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel5.password_resets' doesn't exist


searaig replied 2 years ago

You could just comment out the contents of the down() method in your migration. The issue is caused because Schema::drop('foobar') translates to the sql command DROP TABLE foobar;

So you can comment out the Schema::drop() or try using Schema::dropIfExists() instead.

Hope that helps


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us