Define the primary key
id
is used as primary key.class User extends Model { static entity = 'users' static primaryKey = 'userId' static fields () { return { userId: this.attr(null) } }}
class RoleUser extends Model { static entity = 'roleUser' static primaryKey = ['role_id', 'user_id'] static fields () { return { role_id: this.attr(null), user_id: this.attr(null) } }}
const primaryKey: string | string[] = 'id'