establishing db build order