In addition to the Solar System and its planets, we now have a database of nearly 1000 planets that emphasize the huge diversity of planets and systems that can be formed. This diversity is a challenge for planetary formation models. Type I migration is one of the mechanisms possible to explain this diversity. Depending on disc properties, planets can migrate inward or outward with respect to their host star. The huge parameter space of protoplanetary disc models can form a huge diversity of planetary systems, in agreement with the diversity observed in the nonetheless small sample accessible to us. Thanks to numerical simulations, I showed that within the same disc, it is possible to form super-Earths or giant planet cores, depending on the migration history of an initial population of embryos.