We are using ObjectionJS in our app (Express + NodeJs + Mysql) for a log time but now I want to refactor the code in order to make easier to read and faster to implement, so one of my first approach is to make Objection Model import an external model. This way I don't have to repeat all model fields twice in my business model and again in the objection model. I have search a lot but nothing tells how must be done. Do you have any idea? Thank you very much.
Here is one my models.
export class ExtraSkills extends BaseModel {
extraSkillID?: number;
extraSkillAll?: number;
extraSkillChilds?: number;
static get tableName() {
return "OFFERS_EXTRA_SKILLS";
}
static get idColumn() {
return "OFFERS_EXTRA_SKILLS";
}
}
It would be great if Objection model have some method to import another model in order to avoid redefining same fields...