db restructure