MediaLibrary: Delete and recreate all tables in the same transaction

Fix #399

(cherry picked from commit 5a0ff489)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
10 jobs for !566 with 0.10.x in 7 minutes and 5 seconds (queued for 9 seconds)
latest merge request