fix(database): move db setup before eager loading