you have two tables named "tags" in your migration files
_create_tags_table and _create_tag_table
check the create method in both migrations and rename or delete one.
You should make sure to name tables the "Laravel way" and follow their naming conventions.
In this case, you named the migration ..._create_tag_tables, but the table you create is called tags. Make sure to name the migration the same way.
You already have a migration that creates the tags table. If you want to change that one, you have two options:
If not deployed yet, you can update the existing migration to your needs. Then run php artisan migrate:fresh, what will empty the database and set it up again (all data will get lost).
But never change deployed (or better even pushed) migrations as they will not be run again.
In that case, create a new migration that updates the already existing table.
3
Answers
you have two tables named "tags" in your migration files
_create_tags_table and _create_tag_table
check the create method in both migrations and rename or delete one.
The problem is in
2023_03_09_044748_create_tag_tables
, Change the table name totag
Run
composer dump-autoload
and thenphp artisan migrate:fresh
You should make sure to name tables the "Laravel way" and follow their naming conventions.
In this case, you named the migration
..._create_tag_tables
, but the table you create is calledtags
. Make sure to name the migration the same way.You already have a migration that creates the
tags
table. If you want to change that one, you have two options:If not deployed yet, you can update the existing migration to your needs. Then run
php artisan migrate:fresh
, what will empty the database and set it up again (all data will get lost).But never change deployed (or better even pushed) migrations as they will not be run again.
In that case, create a new migration that updates the already existing table.