mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
WIP Items module.
This commit is contained in:
23
server/src/models/ItemMetadata.js
Normal file
23
server/src/models/ItemMetadata.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import bookshelf from './bookshelf';
|
||||
|
||||
const ItemMetadata = bookshelf.Model.extend({
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*/
|
||||
tableName: 'items_metadata',
|
||||
|
||||
/**
|
||||
* Timestamp columns.
|
||||
*/
|
||||
hasTimestamps: ['created_at', 'updated_at'],
|
||||
|
||||
/**
|
||||
* Item category may has many items.
|
||||
*/
|
||||
items() {
|
||||
return this.belongsTo('Item', 'item_id');
|
||||
},
|
||||
});
|
||||
|
||||
export default bookshelf.model('ItemMetadata', ItemMetadata);
|
||||
Reference in New Issue
Block a user