You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
396 B
JavaScript
21 lines
396 B
JavaScript
"use strict";
|
|
|
|
const { Model } = require("objection");
|
|
|
|
module.exports = function ({ db }) {
|
|
return class Alias extends Model {
|
|
static tableName = "aliases";
|
|
static idColumn = "alias";
|
|
|
|
static get relationMappings() {
|
|
return {
|
|
item: {
|
|
relation: Model.BelongsToOneRelation,
|
|
modelClass: db.Item,
|
|
join: { from: "aliases.itemId", to: "items.id" }
|
|
}
|
|
};
|
|
};
|
|
}
|
|
};
|