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

Region África not found #20

Open
sumannath opened this issue Jul 31, 2023 · 9 comments
Open

Region África not found #20

sumannath opened this issue Jul 31, 2023 · 9 comments

Comments

@sumannath
Copy link

sumannath commented Jul 31, 2023

Using composer to install and then running migrate:refresh --seed, I get the following error:

` Region África not found

at vendor/lwwcas/laravel-countries/src/database/seeders/Builder.php:87
83▕ ->first();
84▕
85▕ if ($response == null) {
86▕ DB::rollBack();
➜ 87▕ throw new Exception('Region ' . $region . ' not found');
88▕ }
89▕
90▕ CountryRegionTranslation::create([
91▕ 'lc_region_id' => $response->id,

  +27 vendor frames 

28 database/seeders/DatabaseSeeder.php:16
Illuminate\Database\Seeder::call()
+34 vendor frames

63 artisan:35
Illuminate\Foundation\Console\Kernel::handle()`

@amharris
Copy link

amharris commented Aug 3, 2023

@sumannath I'm also experiencing this issue, but it seems it occurs with PostgreSQL and not MySQL.

@elcapo
Copy link

elcapo commented Aug 30, 2023

I can confirm that running the seeder in MySQL (and MariaDB) seems to work fine but running it in SQLite (I use it for testing) throws the same exception.

@elcapo
Copy link

elcapo commented Aug 30, 2023

According to the documentation about updating JSON columns:

This operation is supported on MySQL 5.7+ and PostgreSQL 9.5+

In other words, it's apparently a known limitation.

@elcapo
Copy link

elcapo commented Aug 30, 2023

@amharris Are you using PostgreSQL 9.5 or greater? If not, you may consider upgrading to solve this issue.

@amharris
Copy link

@elcapo It's PostgreSQL 15, which is included in Laravel Sail (both the 8.1 and 8.2 Dockerfiles, (but even the 8.0 Dockerfile includes PostgreSQL 13)). It would be good to ensure compatibility what comes out-of-the-box with Sail, given this package is for Laravel.

@RolandVerner
Copy link

RolandVerner commented Feb 5, 2024

same error pgsql 16

Lwwcas\LaravelCountries\Database\Seeders\LanguagesSeeder ........................................................... RUNNING  
 Lwwcas\LaravelCountries\Database\Seeders\Languages\PortugueseLanguageSeeder ........................................ RUNNING  

  Exception 

 Region África not found

 at vendor/lwwcas/laravel-countries/src/database/seeders/Builder.php:87
    83▕                 ->first();
    84▕ 
    85▕             if ($response == null) {
    86▕                 DB::rollBack();
 ➜  87▕                 throw new Exception('Region ' . $region . ' not found');
    88▕             }
    89▕ 
    90▕             CountryRegionTranslation::create([
    91▕                 'lc_region_id' => $response->id,

     +27 vendor frames 

 28  database/seeders/DatabaseSeeder.php:15
     Illuminate\Database\Seeder::call()
     +22 vendor frames 

 51  artisan:35
     Illuminate\Foundation\Console\Kernel::handle()

@adilbekes
Copy link

Any news? I have same with Postgre

@amharris
Copy link

@adilbekes The issue still persists with Postgres.

@sanjarani
Copy link

I have same issue using postgres 16 with laravel 11.

It seems the problem came from portugues Language seeder. Is there a way to ignore this language to make seeder work?

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