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>
8 jobs for !567 with backport_transaction_0.9 in 6 minutes and 4 seconds (queued for 8 seconds)
latest merge request