Makes a "has one" relation of the property
import { Model } from 'pinia-orm'import Phone from './Phone'class User extends Model { static entity = 'users' static fields () { return { id: this.attr(null), name: this.string(''), phone: this.hasOne(Phone, 'userId') } }}
import { Model } from 'pinia-orm'import { Attr, HasOne, Str } from 'pinia-orm/dist/decorators'import Phone from './Phone'class User extends Model { static entity = 'users' @Attr(null) declare id: number | null @Str('') declare name: string @HasOne(() => Phone, 'userId') declare phone: Phone}
function hasOne( related: typeof Model, foreignKey: string, localKey?: string,): HasOne