How to limit sources for Entries field set up via migration I'm seeting up all of my project's fields using migrations.
This works really well, but I haven't been able to figure out how to limit the sources (sections) for an entry selection field.

I've based my work on this migrations example, which contains the following code:

new \craft\fields\Entries([
    "name" =&gt; "Questions",
    "handle" =&gt; "questions",
    "instructions" =&gt; "Choose one or more questions",
    "sources" =&gt; ["section:" . $questionsSection-&gt;id],
    "limit" =&gt; 10,
    "required" =&gt; false,
    "selectionLabel" =&gt; "Select Questions",
]),


However, I don't get how I can add multiple sections as allowed sources… can anybody clarify how to do this?
After getting some feedback from Craft support it turns out one has to use uid instead of id for this to work:

"sources" =&gt; ["section:" . $questionsSection-&gt;uid],


Since I had a lot of places in my migration where I needed to specify sources, I included a couple small functions:

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

protected function _section_id($sectionHandle)
{
    return Craft::$app-&gt;sections-&gt;getSectionByHandle($sectionHandle)-&gt;uid;

} // _section_id()

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */

protected function _source($handle, $kind = 'section')
{
    $source = $kind . ':' . $this-&gt;_section_id($handle);
    return $source;

} // _source()

/* --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- */


You can then limit the entries field sources like so:

"source" =&gt; null,
"sources" =&gt; [
    $this-&gt;_source("sectionA"),
    $this-&gt;_source("sectionB"),
],


(Note that I'm additionally setting "source" =&gt; null as per a plugin-created migration I analyzed, but not sure if it's required.)