     ///         let team: Team = row["custom"]
     ///     }
     var key: String {
-        return sqlAssociation.key
+        return sqlAssociation.destinationKey
     }
     
     /// Creates an association which selects *selection*.

        result.pivot = result.pivot.mapRelation(transform)
        return result
    }

    /// Returns a new association
    func through(_ other: SQLAssociation) -> SQLAssociation {
        return SQLAssociation(steps: other.steps + steps)

            return AssociationStep(key: key, condition: condition, relation: transform(relation))
        }
    }
    
    // All steps, from pivot to destination. Never empty.
    private var steps: [AssociationStep]
    var keyPath: [String] { return steps.map { $0.key} }
    
    private var destination: AssociationStep {
        get { return steps[steps.count - 1] }
        set { steps[steps.count - 1] = newValue }
    }
    var destinationKey: String { return destination.key }
    
    private var pivot: AssociationStep {
        get { return steps[0] }
        set { steps[0] = newValue }
    }
    var pivotCondition: SQLAssociationCondition {
        return pivot.condition
    }
