Fix db structure