mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: Attachment files system.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Model } from 'objection';
|
||||
import TenantModel from '@/models/TenantModel';
|
||||
|
||||
export default class ManualJournal extends TenantModel {
|
||||
@@ -7,4 +8,26 @@ export default class ManualJournal extends TenantModel {
|
||||
static get tableName() {
|
||||
return 'manual_journals';
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship mapping.
|
||||
*/
|
||||
static get relationMappings() {
|
||||
const Media = require('@/models/Media');
|
||||
|
||||
return {
|
||||
media: {
|
||||
relation: Model.ManyToManyRelation,
|
||||
modelClass: this.relationBindKnex(Media.default),
|
||||
join: {
|
||||
from: 'manual_journals.id',
|
||||
through: {
|
||||
from: 'media_links.model_id',
|
||||
to: 'media_links.media_id',
|
||||
},
|
||||
to: 'media.id',
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
10
server/src/models/MediaLink.js
Normal file
10
server/src/models/MediaLink.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import TenantModel from '@/models/TenantModel';
|
||||
|
||||
export default class MediaLink extends TenantModel {
|
||||
/**
|
||||
* Table name
|
||||
*/
|
||||
static get tableName() {
|
||||
return 'media_links';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user