I did was to create another migration file
So, you probably introduced a second migration which attempts to create a roles table?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
After working on the project during the week I introduced some new tables, altered some columns but now that I've deployed the changes to github and then deploying those changes on Heroku, after accessing the site online, I get a 500 Server Error.
Went into the bash (heroku run bash) and ran php artisan migrate but I got this message:
In Connection.php line 678:
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "roles" already exists
(SQL: create table "roles" ("id" bigserial primary key not null, "name" va
rchar(255) not null, "label" varchar(255) null, "created_at" timestamp(0) w
ithout time zone null, "updated_at" timestamp(0) without time zone null))
In Connection.php line 471:
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "roles" already exists
I rolled back the migrations and ran the migrations again but yet again Im still reading the same message above, how can I make this one go away?
At this point and because the nature of the project is NOT professional or for another person I could run fresh but I want to learn because on development I faced this error and let's say I never got to "fixing" it, all I did was to create another migration file and copied and pasted the code that I had. Thanks!
I did was to create another migration file
So, you probably introduced a second migration which attempts to create a roles table?
Please or to participate in this conversation.