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

Seeder: SQL Error: Duplicate entry for '1' key 'PRIMARY' #2762

Closed
theanadimukt opened this issue Mar 25, 2020 · 1 comment
Closed

Seeder: SQL Error: Duplicate entry for '1' key 'PRIMARY' #2762

theanadimukt opened this issue Mar 25, 2020 · 1 comment
Labels
Bug Fixed When bug issue is fixed. Bug Something isn't working.

Comments

@theanadimukt
Copy link

**when run seeder on existing database using php artisan db:seed, throws error like below **

  1. CategoryTableSeeder :
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY' (SQ L: insert into category_translations

  2. ChannelTableSeeder
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-1' for key 'PRIMARY' ( SQL: insert into channel_currencies

I think, you should add line DB::table('channel_currencies')->delete(); for channel_currencies table and for other tables as well in CategoryTableSeeder & ChannelTableSeeder.

@jitendra-webkul jitendra-webkul added the Bug Something isn't working. label May 13, 2020
jitendra-webkul added a commit that referenced this issue May 15, 2020
@jitendra-webkul jitendra-webkul added the Bug Fixed When bug issue is fixed. label May 15, 2020
@vaishaliwebkul
Copy link

@sagarpatel9697
We are closing the issue, Feel free to reopen anytime if it's not resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fixed When bug issue is fixed. Bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

3 participants