Revert "Hotfix for database error"

This reverts commit 4f14514c34c4ec96d6af678e4bac8d5a8c3c94fe.
Partial revert i8a209de46637028fa01c6d6ce2e62d2bba66f569