DB relationships and indexes setup