bagisto / laravel-data-faker

Creates fake data of products and customers for testing
MIT License
22 stars 23 forks source link

Solve integrity constraint violation #19

Closed AbdElrahmaN31 closed 2 years ago

AbdElrahmaN31 commented 2 years ago

The defualt seeder in bagisto create a root category with id 1 and category translations with id (1,2,3,4,5). So this seeder should start counting category_translations's id from 6

AbdElrahmaN31 commented 2 years ago

@devansh-webkul , It's nice if you take a look here.

devansh-webkul commented 2 years ago

@AbdElrahmaN31,

I am not facing this issue. This worked in my instance properly. If you check the code, categories are already deleting,

https://github.com/bagisto/laravel-data-faker/blob/4cc3ffcd871ce2c854368072ac0cb49db4d1961a/src/Database/Seeders/ProductCategoryTableDataSeeder.php#L13

Well, this whole package needs improvement also. I recommend you to do all changes to your fork.