DB schema bug fixes

Various bug fixes to fix the unit test for db_group_policy