fix: inventory adjustment cost out of range.

This commit is contained in:
a.bouhuolia
2021-08-07 08:09:37 +02:00
parent 0ab4596836
commit c21236c4ae
4 changed files with 32 additions and 14 deletions

View File

@@ -1,16 +1,25 @@
exports.up = function(knex) {
return knex.schema.createTable('inventory_adjustments_entries', table => {
exports.up = function (knex) {
return knex.schema.createTable('inventory_adjustments_entries', (table) => {
table.increments();
table.integer('adjustment_id').unsigned().index().references('id').inTable('inventory_adjustments');
table
.integer('adjustment_id')
.unsigned()
.index()
.references('id')
.inTable('inventory_adjustments');
table.integer('index').unsigned();
table.integer('item_id').unsigned().index().references('id').inTable('items');
table
.integer('item_id')
.unsigned()
.index()
.references('id')
.inTable('items');
table.integer('quantity');
table.decimal('cost').unsigned();
table.decimal('value').unsigned();
table.decimal('cost', 13, 3).unsigned();
table.decimal('value', 13, 3).unsigned();
});
};
exports.down = function(knex) {
exports.down = function (knex) {
return knex.schema.dropTableIfExists('inventory_adjustments_entries');
};