mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: Re-compute the given items cost job.
feat: Optimize the architecture.
This commit is contained in:
@@ -4,9 +4,9 @@ import knexfile from '@/../config/systemKnexfile';
|
||||
|
||||
const config = knexfile[process.env.NODE_ENV];
|
||||
|
||||
const knex = Knex({
|
||||
...config,
|
||||
...knexSnakeCaseMappers({ upperCase: true }),
|
||||
});
|
||||
|
||||
export default knex;
|
||||
export default () => {
|
||||
return Knex({
|
||||
...config,
|
||||
...knexSnakeCaseMappers({ upperCase: true }),
|
||||
});
|
||||
};
|
||||
@@ -6,9 +6,9 @@ exports.up = function(knex) {
|
||||
|
||||
table.string('direction');
|
||||
|
||||
table.integer('item_id');
|
||||
table.integer('quantity');
|
||||
table.decimal('rate', 13, 3);
|
||||
table.integer('item_id').unsigned();
|
||||
table.integer('quantity').unsigned();
|
||||
table.decimal('rate', 13, 3).unsigned();
|
||||
|
||||
table.string('transaction_type');
|
||||
table.integer('transaction_id');
|
||||
|
||||
@@ -6,9 +6,11 @@ exports.up = function(knex) {
|
||||
|
||||
table.string('direction');
|
||||
|
||||
table.integer('item_id');
|
||||
table.integer('item_id').unsigned();
|
||||
table.integer('quantity').unsigned();
|
||||
table.decimal('rate', 13, 3);
|
||||
table.integer('remaining');
|
||||
table.string('lot_number');
|
||||
|
||||
table.string('transaction_type');
|
||||
table.integer('transaction_id');
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Model } from 'objection';
|
||||
import knex from '@/database/knex';
|
||||
|
||||
// Bind all Models to a knex instance. If you only have one database in
|
||||
// your server this is all you have to do. For multi database systems, see
|
||||
// the Model.bindKnex() method.
|
||||
Model.knex(knex);
|
||||
export default ({ knex }) => {
|
||||
Model.knex(knex);
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@ exports.seed = (knex) => {
|
||||
return knex('resources').insert([
|
||||
{ id: 1, name: 'accounts' },
|
||||
{ id: 8, name: 'accounts_types' },
|
||||
|
||||
{ id: 2, name: 'items' },
|
||||
{ id: 3, name: 'expenses' },
|
||||
{ id: 4, name: 'manual_journals' },
|
||||
|
||||
Reference in New Issue
Block a user