firstOrCreate(['id' => Artist::UNKNOWN_ID], ['name' => Artist::UNKNOWN_NAME]); self::maybeResetPgsqlSerialValue(); } private static function maybeResetPgsqlSerialValue(): void { if (DB::getDriverName() === 'pgsql') { DB::statement( "SELECT setval(pg_get_serial_sequence('artists', 'id'), coalesce(max(id), 0) + 1, false) FROM artists" ); } } }