Type alias BelongsToField<T, K, FK>

BelongsToField<T, K, FK>: FK extends keyof T
    ? T[FK] extends NullableForeignKey
        ? Optional<K>
        : K
    : never

If the relationship is linked by a NullableForeignKey then it allows the field to be optional, otherwise it ensures that is is not optional

Type Parameters

Generated using TypeDoc