From 7147e230de7fa745dd8e4b78b9d01d3d24646fa3 Mon Sep 17 00:00:00 2001 From: Denis Date: Thu, 1 Aug 2024 16:31:14 +0300 Subject: [PATCH] Increased tax_amount_withheld decimal precision Fixing #547 --- ...ision_in_bills_and_sales_invoices_tables.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/server/src/database/migrations/20240801130829_change_tax_amount_withheld_column_precision_in_bills_and_sales_invoices_tables.js diff --git a/packages/server/src/database/migrations/20240801130829_change_tax_amount_withheld_column_precision_in_bills_and_sales_invoices_tables.js b/packages/server/src/database/migrations/20240801130829_change_tax_amount_withheld_column_precision_in_bills_and_sales_invoices_tables.js new file mode 100644 index 000000000..e03346a5f --- /dev/null +++ b/packages/server/src/database/migrations/20240801130829_change_tax_amount_withheld_column_precision_in_bills_and_sales_invoices_tables.js @@ -0,0 +1,18 @@ +// This migration changes the precision of the tax_amount_withheld column in the bills and sales_invoices tables from 8, 2 to 13, 2. +// This migration is necessary to allow tax_amount_withheld filed to store values bigger than 999,999.99. + +exports.up = function(knex) { + return knex.schema.alterTable('bills', function (table) { + table.decimal('tax_amount_withheld', 13, 2).alter(); + }).alterTable('sales_invoices', function (table) { + table.decimal('tax_amount_withheld', 13, 2).alter(); + }); +}; + +exports.down = function(knex) { + return knex.schema.alterTable('bills', function (table) { + table.decimal('tax_amount_withheld', 8, 2).alter(); + }).alterTable('sales_invoices', function (table) { + table.decimal('tax_amount_withheld', 8, 2).alter(); + }); +}; \ No newline at end of file