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

Seeding Data more than 500 records failed in SQLite #5

Open
danangprass opened this issue Nov 12, 2024 · 2 comments
Open

Seeding Data more than 500 records failed in SQLite #5

danangprass opened this issue Nov 12, 2024 · 2 comments

Comments

@danangprass
Copy link

danangprass commented Nov 12, 2024

hello @lakuapik ,
I encountered an issue when seeding data in SQLite. The process failed when inserting more than 500 records (specifically in the District and Village datasets). I was able to resolve it by adding the following line of code::

in District:

From:

District::insert($this->mapVillagesData($data));

To:

   DB::transaction(function () use ($data) {
            foreach (array_chunk($this->mapDistrictsData($data), 500) as $chunk) {
                District::insert($chunk);
            }
        });

in Village:

From:

Village::insert($this->mapVillagesData($data));

To:

   DB::transaction(function () use ($data) {
            foreach (array_chunk($this->mapVillagesData($data), 500) as $chunk) {
                Village::insert($chunk);
            }
        });

It’s a minor issue, but I believe implementing this fix could enhance seeding reliability in SQLite.

@lakuapik
Copy link
Member

@danangprass thanks for finding this issue, a PR is welcome.

@danangprass
Copy link
Author

Hi @lakuapik , I wanna create PR but I don't have permission.
Please grant the access, thanks
image

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

No branches or pull requests

2 participants