Get schedule from database