laravel-countries
laravel-countries copied to clipboard
Region África not found
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()`
@sumannath I'm also experiencing this issue, but it seems it occurs with PostgreSQL and not MySQL.
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.
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.
@amharris Are you using PostgreSQL 9.5 or greater? If not, you may consider upgrading to solve this issue.
@elcapo It's PostgreSQL 15, which is included in Laravel Sail (both the 8.1 and 8.2 Dockerfile
s, (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.
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()
Any news? I have same with Postgre
@adilbekes The issue still persists with Postgres.
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?