[x] Fixing a bug when database migration doesn't work well
Merge commit 'a6b0d82cf51878e17f34ea2796cc1e77c60d9c59'