prepare specs to join tables