Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX][php]:BlogSeeder issue on php artisan db:seed #618

Open
cyrilmano opened this issue Feb 26, 2025 · 2 comments
Open

[FIX][php]:BlogSeeder issue on php artisan db:seed #618

cyrilmano opened this issue Feb 26, 2025 · 2 comments
Assignees

Comments

@cyrilmano
Copy link

cyrilmano commented Feb 26, 2025

Description:

Below is the error message, and also find included, screenshots of the error;

Database\Seeders\BlogSeeder ............................................................................... RUNNING  

   Illuminate\Database\QueryException 

  SQLSTATE[42000]: Syntax error or access violation: 1701 Cannot truncate a table referenced in a foreign key constraint (`hng_boilerplate`.`comments`, CONSTRAINT `comments_blog_id_foreign`) (Connection: mysql, SQL: truncate table `blogs`)

  at vendor\laravel\framework\src\Illuminate\Database\Connection.php:829
    825▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    826▕                 );
    827▕             }
    828▕
  ➜ 829▕             throw new QueryException(
    830▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    831▕             );
    832▕         }
    833▕     }

SCREENSHOTS OF ERROR;

Image

@cyrilmano cyrilmano changed the title BlogSeeder issue on php artisan db:seed [FIX][php]:BlogSeeder issue on php artisan db:seed Feb 26, 2025
@cyrilmano
Copy link
Author

Issue created by: [email protected]
Slack Display Name: ThankGod Cyril Uche on LinkedIn

@omotomiwa26
Copy link
Contributor

Use This Issue Template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants