replace unique validation to other db structure