Check database version on each reference, move database setup