Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sam0081's avatar

need to solve 2 error

  1. Base table or view already exists: 1050 Table 'users' already exists error occue when i run

php artisan migrate

  1. i create a migration for one table call:- currency but when i fetching data from that table using module it fetching data from table currencies.

any solution for this

0 likes
4 replies
IgorBabko's avatar

Hey -

Try to run php artisan migrate:fresh - that will delete all of your existing tables and create them again. If the error still exists then you have more than one migration for creating users table. Delete one of them and you should be good to go.

According to default eloquent conventions: eloquent model tries to fetch data from the pluralized model name ( if you have table called currency, by default it will try to fetch data from currencies table ).

So, to manually specify table name you have to add $table property to your model like so:

protected $table = 'currency';
sam0081's avatar

@IgorBabko :- is there any way to do this without deleting other table.because i have added some custom column..''

and thanks for other solutions.

IgorBabko's avatar
Level 36

@sam0081 -

If you don't use your database on production, just freely fresh all database by using php artisan migrate:fresh.

If you keep all your database structure in migrations then php artisan migrate:fresh will set everything back after deleting all tables. And you can identify your problem this way faster.

Please or to participate in this conversation.