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, Attr, Str, HasOne } from 'pinia-orm'import Phone from './Phone'class User extends Model { static entity = 'users' @Attr(null) id!: number | null @Str('') name!: string @HasOne(() => Phone, 'userId') phone!: Phone}
function hasOne( related: typeof Model, foreignKey: string, localKey?: string,): HasOne