Makes a "belong to" relation of the property
import { Model } from 'pinia-orm'import User from './User'class Phone extends Model { static entity = 'users' static fields () { return { id: this.attr(null), userId: this.attr(null), number: this.string(''), user: this.belongsTo(User, 'userId') } }}
import { Model, Attr, Str, BelongsTo } from 'pinia-orm'import User from './User'class User extends Model { static entity = 'users' @Attr(null) id!: number | null @Attr(null) userId!: number | null @Str('') number!: string @BelongsTo(() => User, 'userId') user!: User}
function belongsTo( related: typeof Model, foreignKey: string, ownerKey?: string,): BelongsTo