Makes a "has many" relation of the property
import { Model } from 'pinia-orm'import Comment from './Comment'class Post extends Model { static entity = 'posts' static fields () { return { id: this.attr(null), title: this.string(''), comments: this.hasMany(Comment, 'postId') } }}
import { Model, Attr, Str, HasMany } from 'pinia-orm'import Comment from './Comment'class Post extends Model { static entity = 'posts' @Attr(null) id!: number | null @Str('') title!: string @HasMany(() => Comment, 'postId') comments!: Comment[]}
function hasMany( related: typeof Model, foreignKey: string, localKey?: string,): HasMany