diff --git a/backend/patches/fixItemHSNField.ts b/backend/patches/fixItemHSNField.ts new file mode 100644 index 00000000..5027b045 --- /dev/null +++ b/backend/patches/fixItemHSNField.ts @@ -0,0 +1,11 @@ +import { DatabaseManager } from '../database/manager'; + +async function execute(dm: DatabaseManager) { + const knexSchema = dm.db?.knex?.schema; + + await knexSchema?.alterTable('Item', (table) => { + table.text('hsnCode').alter(); + }); +} + +export default { execute, beforeMigrate: true }; diff --git a/backend/patches/index.ts b/backend/patches/index.ts index c9df6a2a..78edbe84 100644 --- a/backend/patches/index.ts +++ b/backend/patches/index.ts @@ -6,6 +6,7 @@ import testPatch from './testPatch'; import updateSchemas from './updateSchemas'; import setPaymentReferenceType from './setPaymentReferenceType'; import fixLedgerDateTime from './v0_21_0/fixLedgerDateTime'; +import fixItemHSNField from './fixItemHSNField'; export default [ { name: 'testPatch', version: '0.5.0-beta.0', patch: testPatch }, @@ -40,4 +41,5 @@ export default [ version: '0.21.2', patch: fixLedgerDateTime, }, + { name: 'fixItemHSNField', version: '0.24.0', patch: fixItemHSNField }, ] as Patch[];