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