typeKey
Look at Single Table Inheritance for more detail
Usage
import Person from './models/Person'
import Adult from './models/Adult'
import { Model } from 'pinia-orm'
class User extends Model {
static entity = 'users'
static typeKey = 'person_type'
static types () {
return {
PERSON: Person,
ADULT: Adult
}
}
static fields () {
return {
id: this.uid(),
name: this.string()
}
}
}
Typescript Declarations
const typeKey: string = 'type'
Table of Contents