Support the ongoing development of Laravel.io →
Authentication Database Eloquent
Last updated 2 years ago.
0

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'


0

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

0

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


0

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

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

omidnikrah omidnikrah Joined 15 Jul 2015

Moderators

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

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.