2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 10:58:59 +00:00

fix: #808 Payment referenceType NULL due to bad migration

This commit is contained in:
Mildred Ki'Lya 2024-01-16 23:46:01 +01:00
parent c7c7aae1f4
commit 27d67a33e5
2 changed files with 15 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import createInventoryNumberSeries from './createInventoryNumberSeries';
import fixRoundOffAccount from './fixRoundOffAccount';
import testPatch from './testPatch';
import updateSchemas from './updateSchemas';
import setPaymentReferenceType from './setPaymentReferenceType';
export default [
{ name: 'testPatch', version: '0.5.0-beta.0', patch: testPatch },
@ -28,4 +29,9 @@ export default [
version: '0.6.6-beta.0',
patch: createInventoryNumberSeries,
},
{
name: 'setPaymentReferenceType',
version: '0.21.0',
patch: setPaymentReferenceType,
},
] as Patch[];

View File

@ -0,0 +1,9 @@
import { DatabaseManager } from '../database/manager';
async function execute(dm: DatabaseManager) {
await dm.db!.knex!('Payment')
.where({ referenceType: null })
.update({ referenceType: 'SalesInvoice' });
}
export default { execute, beforeMigrate: true };