To make sure the replacing code will acchieve the same things as the
actual one, we replace the raw SQL query with the DBIC version of it.
Then the tests will show us that they are equivalent.
Test plan:
Apply only this patch, run the tests, confirm they pass.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>