Refine DB structure. Added necessary not-null constraints.