  We present numerical simulations of the magnetic field turbulence in
collisionless electron-positron plasma with continuous injection of new pairs,
which maintains anisotropy in the particle distribution over long time. {With
these simulations we follow evolution of a small (and therefore uniform) region
in the fluid comoving frame modelling} generation and decay of the magnetic
field in shocks, where the upstream is modified by two-photon pair production
due to self-absorption of the shock's high-energy radiation. We find that the
overall picture of magnetic field build-up is consistent with development of
Weibel instability. However, the long-term injection of anisotropic pairs in
the upstream leads to formation of large-scale structures in the magnetic
field, while the small-scale structures are almost absent. We find that being
amplified at the shock front this magnetic field mostly preserves its large
spatial scale and then slowly decays in the downstream on a timescale
approximately equal to duration of the injection phase. The observed decay of
the magnetic field is in exceptionally good agreement with predictions of the
so-called phase mixing model. Generation of the long-lived magnetic field in
relativistic collisionless shocks with injection-modified upstream explains how
they can efficiently produce the synchrotron radiation in Gamma-Ray Bursts.
